How To Embed Youtube Videos with Specific Start and End Times

Oct 5 • Featured, Video Marketing10 Comments

How To Embed Youtube Videos with Specific Start and End Times

Ever wanted to share just a short part of a long video on your blog? Sometimes we come across a quite long video on Youtube and pick up something from it that we want to share. It can be a problem if we want to share only a certain part of it and not the rest of the video.

That’s the trouble I was facing when I wanted to embed a Youtube video on this post.

Fortunately, if it’s on Youtube, you don’t really have to download the video, edit it yourself and re-upload the part you want to share. That will take too much time. Here’s how to quickly embed a Youtube video with specified start time and end time.

  1. First thing you have to do is of course get the specific time you want your embedded video to start and the specific time you want it to end at. Then convert them into seconds. Let’s say you want to embed only the part of the video starting from 02:16 up to 02:58.
     
    In seconds, your start time would be ( 2 * 60 ) + 16 = 136 and your end time would be ( 2 * 60 ) + 58 = 178.
     
  2. Next, grab the embed code from the Youtube video, and append the following parameters to the video URL in the embed code:
     
    ?start=[your_start_time]&end=[your_end_time]&version=3
     
    Replace [your_start_time] and [your_end_time] with your actual start and end times in seconds so that your embed code would look like this:
     

    <iframe width="560" height="315"
    src="//www.youtube.com/embed/Ua3dUrY9HJ8?start=136&end=178&version=3"
    frameborder="0" allowfullscreen>
    </iframe>

The version parameter there specifies the Youtube player version that should be used for your embedded video. Version 3 is the only version that supports the end parameter so if you want to specify an end time for your embedded video, make sure to specify version 3 as the player to be used in your embedded video.

If you only want to specify a starting time and no end time, you can just omit the end parameter entirely.

And that’s it, your embedded video should only play the part that you have specified. Just like in the following example:

Summary
Article Name
How To Embed Youtube Videos with Specific Start and End Times
Author
Description
Ever wanted to share just a short part of a long video on your blog? Here's how to quickly embed a Youtube video with specified start time and end time.

Related Posts

  • Anwar Bashir

    The above code and embed code works fine from your site (even on iPhone), but when I embed on my own site the video will play from the start to the end, but then starts from the beginning not the start if repeat is required. The other example on the uses the AS3 player with the http://www.youtube.com/v/VIDEO_ID?version3. This works on browsers but the embed code will not work on iPhone. I think there is a bug in the IFrame embed http://www.youtube.com/Video_ID or some problem. However you appear to have been able to overcome this somehow as your code works!!! Could you try the embed code above in a vanilla page and confirm my findings. Then if possible could you advise how to code so that it will work as above? Many Thanks.

  • Paolo Antonucci

    It works! Thank you very much!

  • Max Greenflame

    Is there any way to get rid of the option to view the full video? What if I don’t want my blog visitors to watch my long video till the end. Thanks.

    • http://nimrodflores.com/ Nimrod Flores

      Youtube will always put a link to the full version of the video on their site. Even when you disable the video info, the youtube watermark at the bottom right of the vid links to the page for that video on youtube.

      To accomplish what you described, you’ll have to rip the video from youtube and edit it to lift only the part you want. Then upload that back to youtube.

  • HerrinSchadenfreude

    Why doesn’t this work anymore? It just keeps playing after the end time as if none was specified, even with the end parameter in there. It starts at the right time, but when you look at the location bar it has dropped the start and end parameters and reloaded the video without them.

    • http://nimrodflores.com/ Nimrod Flores

      Hey Herrin, thanks for pointing that out. Yeah, it is kinda weird… from my computer here, it still starts and ends at the right times I specified, but upon page load, I see that the progress bar doesn’t display anymore the part I specified to be played.

      I just checked Youtube’s developer documentation, but there doesn’t seem to be any change on these parameters.. So I’m also not sure what’s really happening with their player.

      Guess we’ll just have to find out a little later…

  • Jelila jelila

    Nimrod you’re a hero! thank you sooo much! this enables me to embed video on my wordpress site and start where I want! fabulous! so very helpful! thanks a mill! :D

    • http://nimrodflores.com/ Nimrod Flores

      No problem. Glad you find it useful! :)

  • http://thevirtualonlineassistant.com/ Nica, Virtual Assistant

    This is a great tip, Nimrod! I didn’t know about this before. It’s a great idea if you want to give a sneak peak to premium video content and not have to do a separate video just for the teaser. Awesome!

    • http://nimrodflores.com/ Nimrod Flores

      Thanks Nica. Yep you can use this hack for that. But remember, users will still be able to access the rest of the video if they click through to Youtube and watch the video from there.

      So if what you mean by premium is “paid” content, this might not be a good idea. But if it’s just premium because it’s special and you’re not charging people to access it, then this trick should do.

« »