FBML Code For Embedding You Tube Videos

Adding A You Tube Video To A Static FBML Fanpage

I have several auto-blogs and websites, but when I read that Facebook was getting more traffic than Google I had to take a deeper look at the content I had posted to my Facebook fanpages using static FBML pages. 

If you have a basic understanding of html & css you won't have any problems, but finding the right code to add a You Tube video to your page could be a headache.  It took me eight attempts before finding static FBML code that actually worked.

Lets say you want to add a silly video like Viking Kittens.  You'll need to locate the URL for the video which you can find under the “share” button.

It should look like this:

http://www.youtube.com/watch?v=ZVjepq5BgfU


Here’s the code you need to put on your Static FBML page:

swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;"
swfsrc='http://www.youtube.com/v/xxxxxxxxxx'
imgsrc='http://img.youtube.com/vi/xxxxxxxxxx/2.jpg' width='340' height='270' />

Replace “xxxxxxxxxx” with the YouTube video ID, which is the string of characters after the “v=” in the URL in your browser’s address bar (up to the “&” or anything following it, if you see that after the string of letters and numbers). For example:

http://www.youtube.com/watch?v=ZVjepq5BgfU

You would replace “xxxxxxxxxx” with “ZVjepq5BgfU″ in both places, resulting in:


swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;"
swfsrc='http://www.youtube.com/v/ZVjepq5BgfU'
imgsrc='http://img.youtube.com/vi/ZVjepq5BgfU/2.jpg' width='340' height='270' />

You can change the values for “swfbgcolor” and “imgstyle” to your own preferences. 


No comments:

Post a Comment