sometimes you may need to embed just a part of a YouTube recording in your web pages.
For example, you are embedding a show from YouTube but essential the viewer to focussing of one specific photo that begins at 'x' seconds and ends at 'y' seconds. When the photo has completed, the embedded lop should place activity disregarding of the length of the recording.
Easily, here are two easy structure to improve you embed a location of any YouTube video:
Example A: Embed YouTube Recording with start of the Clip
This is a scenario where you choose a signaling reading for the embedded recording and let it amount finished the end. Here you can use the stock embed encrypt and attach the signal time parameter to the YouTube URL as illustrated in the multitude example:
Change VIDEO_ID with the existent ID of your YouTube recording and Replace 1234s with the play time (in seconds). For example, if you want the recording to play playback at the 03:24 (mm:ss) mark, you'll set the time as t=204s (60*3 + 24).
Example B: Embed YouTube Recording with Start & End Time
The folowing YouTube recording from a Galaxy s4 Presentation is over 50 minute tenacious but I have only embedded the most gripping 2-minute section ...
this is a quick demo
The accepted YouTube embed codification doesn't keep the end time parameter but we can get use of the YouTube JavaScript API to embed a portion of any YouTube recording/video. Without slow or boring you with the technical details, here's the new Code:
You have only to change the Video ID, the commencement time (in seconds), the end time (in seconds), the heigh of the contestant (in pixels) and the width in the <DIV> tag as per your needs.
if you are planning to use this embed code on a popular site, please host the youtube-embed.js file on your own server as googlecode.com may offer limited bandwidth.
SHARE THIS
Comment