NOTE: This is the OLD way to do this… YouTube updated their code and HERE is the new way to stop and stop YouTube videos
It’s too early for this.
Ms. Client: Hey Amy, can you add this YouTube video to my site… but only play it from 3:30 to 5:15?
Me [before morning coffee]: Uuummmm. Well. Aahhh. I can give it a try. Send me a link to it.
Ms. Client: Yeah, I just want you to cut apart the man’s p***s
Me: Huh? Whaaaa?
Ms. Client: I said I want you to cut that part because Stan’s a bit squeamish
Me: Ooohhhh. Ohhh. Ha. I thought you said…. ok, nevermind.
Sometimes a client wants to embed a YouTube video on their site but they only want a segment of the video (for whatever reason), not the entire thing.
Soooo what do you do?
Well, here’s a quick YouTube embed hack to make embedded YouTube videos start and stop when you want.
Normally when you creating YouTube embed code it looks something like this:
<iframe src=”http://www.youtube.com/embed/v9T5J7UWMm8?rel=0&autoplay=0″ width=”640″ height=”360″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe>
However, if you add &start=120&end=125 at the end of the iframe src, so like this:
<iframe src=”http://www.youtube.com/embed/v9T5J7UWMm8?rel=0&autoplay=0&start=120&end=125” width=”640″ height=”360″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe>
Something awesome happens… press play below and wait 5 seconds
Notice how it STARTED at the 2 minute mark and ENDED at 2 minutes and 5 seconds?
Those times were specific IN SECONDS when you added this to the embed code: &start=120&end=125
The 120 refers to the 2 minute mark and the 125 refers to the 2 minute and 5 second mark.
So change those variables to whatever time you want.
Does that make sense?
Give it a try!
Amy & Ian Anderson
PS: Always drink your morning coffee before you take a phone call from a client.
PPS: My lifelong dream is to be on this hilarious Japanese game show.
Watch photo by Harsha K R