Wednesday, December 10, 2008

Technical aid for bloggers

Most of my readers are themselves bloggers. This tip is primarily for them. Actually, it's my notes so I won't forget, but that doesn't make me look at all magnanimous, does it?

It's fairly easy to embed video in your page. You go to YouTube, find your video, and copy/paste the contents of the "Embed" field on the right to your site. But you don't necessarily want to show the whole video. For example, I want to share a video of John Barrowman (Capt. Jack Harness from Dr. Who and Torchwood) singing "Sunset Boulevard" on the show "Sound of Musicals". But the video YouTube includes John and Andrew Lloyd Webber blathering on. I want to cut straight to the song.

Here's what you'd get from YouTube
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/aAoief6UgOw&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aAoief6UgOw&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

But if you add in a short code in a couple of places you can control where it starts.
Add "&start=78" or something similar to the value.
Let me explain.
The ampersand separates variables in the string. So you'll need that to separate the "start" command from the other variables. Without that you'll only turn another variable into hash.
The number is where you want the video to start in seconds. I my case the music starts at 1:18 so I put in 781.
So what you'll get is

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/aAoief6UgOw&hl=en&fs=1&start=78"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aAoief6UgOw&hl=en&fs=1&start=78" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

So you end up with this.



1 Do I really need to explain that's 60 seconds for the first minute plus 18 seconds into the second minute?

4 comments:

Ibid said...

test comment

Sweetly Single said...

beeeeeeeeeeppppppppp

GreenCanary said...

Oh, to say that I love John Barrowman would be an understatement. I care not that he's gay. In fact, I'd stalk both him AND his husband. Such cuties.

lacochran said...

Handy info. Thanks!