How to Embed a Portion of Youtube Videos


YouTube Dark

If you have your own website to blog and want to share the interested or important of a movie or video by embedding them into your site then you are right place. YouTube allows you to embed a portion of a video to the webpages without making much effort.

Suppose, you are embedding a movie from YouTube but want the viewer to watch only the particular scene that starts at ‘x’ seconds and finish at ‘y’ seconds(according to the video length obviously). When the scene has finished, the embedded clip should stop playing irrespective of the length of the video.

There are basically two ways to accomplish this task, either by embedding the video by adding only starting time or adding both starting and finish timings.

How to Embed a Portion of Youtube Videos

Method 1st : Embed YouTube Video with only Start Time

In this case you just need to set the starting time and the video will run throughout the end. You can do this with any video available at YouTube.

Here is how you can use the embed code provided by YouTube and add the specific start time parameter to the YouTube URL as shown below in the example:

<iframe width="500" height="300" frameborder="0" allowfullscreen

This the standard YouTube embed code, here you just need to do couple of changes, here is what you need to change: Replace VIDEO_ID with the actual ID of your YouTube video and replace 1234s with the start time (in seconds). For instance, if you want the video to start playback at the 03:24 (mm:ss) mark, you will specify the time as t=304s (60*5 + 4).

Method 2nd: Embed YouTube Video with Start and End time

Here, easily you can share only a specific part of video with certain start and end time. Here is a popular video slideshow on what Cricketers think about Sachin Tendulkar, I have only embedded the most interesting 2-minute segment (22:10 – 24:26) where Obama said about the Sachin 10 seconds portion (0.47 – 0.57).

Here is the code to embed to your website.

<div videoID="ZngdL909h4w" startTime="47" endTime="57" height="400" width="640" id="youtube-player"></div>
 <script src=""></script>

See this annotated source code to learn how the playback is controlled via the YouTube API.