Tuesday, July 22, 2008

How to add the "FullScreen" button to the YouTube video player.

Sometimes when you post a YouTube video to your blog with the 'embed' code, it will not have the "FullScreen" button in the player. If you get an embed that does this, here is how to add the "FullScreen" option to the player code.

Step by step:

I just copy the whole embed over to Notepad++ and use the "Replace" command. I use Notepad++ because you can save changes like this in the replace command, and even write a macro that will do it automatically. You can do it in Windows Notepad also, but can't save the code for next time. I haven't used the Mac editor in a couple of years, but it should be similar.

Replace both instances of hl=en
With this hl=en&fs=1

Insert <param name="allowFullScreen" value="true"></param>
Before <embed

Replace this shockwave-flash"
With this shockwave-flash" allowfullscreen="true"

Here is an example with real code. I've colored the added code green:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/JeaBNAXfHfQ&amp;hl=en&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/JeaBNAXfHfQ&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
That's all there is to it.

Here is the example with the original code:



Here is an example with the changed code:



Enjoy Sister Rosetta Tharpe also. She is fantastic.

No comments: