8:10 PM

Saturday, October 11, 2008

Embed Video in sidebar

A blog reader asked how to embed a video into the sidebar. I have embedded a video into the right-most sidebar at the bottom of Dummies Guide to Google Blogger. The method is not much different from the procedure to embed a as explained in embed Youtube video in blog post, but for completeness and simplicity, I will explain the procedure in full here:

The very first step is to find out the width of the sidebar as explained in how to determine the width of the blog Header, main column and sidebars. The blog Dummies Guide to Google Blogger uses a 4 column Minima template and the width of the right-most sidebar is 164 pixels.

The original embed script of the video is pasted into the scroll box below with the width and height attributes highlighted in red:

width="400" height="333">width="400" src="http://www.youtube.com/v/bU4gXHkejMo&rel=1" wmode="transparent" height="333" type="application/x-shockwave-flash">

We have to resize the video to fit into the sidebar. The easiest way is to first create an empty image with a photo editor such as the free Irfanview with the same width and height as the video (400x333). Then, with the option to preserve aspect ratio ticked, the width is changed to 160 and the corresponding height is noted (in this case I found it to be 133). So I changed all the width attributes to 160 and all the height attributes to 133.

I then get into the LAYOUT and clicked "Add a gadget" (previously "Add a Page Element") and then select HTML/Javascript and pasted the edited Youtube embed script into the page element:

width="160" height="133">width="160" src="http://www.youtube.com/v/bU4gXHkejMo&rel=1" wmode="transparent" height="133" type="application/x-shockwave-flash">

Peter Chen's nice graphic signature

0 comments: