Return to Snippet

Revision: 39481
at January 18, 2011 02:06 by thesmu


Initial Code
Embed a YouTube video using FBML

Here's the code you put on your Static FBML page:

<fb:swf
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=JOt2Qp0H9G8&feature=related

You would replace "xxxxxxxxxx" with "JOt2Qp0H9G8" in both places, resulting in:

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

You can also change the values for "swfbgcolor" and "imgstyle" to your preferences.

The value "swfsrc" is the absolute URL to the Flash file you want to embed (YouTube videos are in Flash format).

Read more: http://www.hyperarts.com/blog/how-to-embed-youtube-videos-flash-facebook-static-fbml-pages/#ixzz1BIzHjWYd

Initial URL
http://www.hyperarts.com/blog/how-to-embed-youtube-videos-flash-facebook-static-fbml-pages/

Initial Description


Initial Title
Youtube  video / swf in static FBML

Initial Tags
facebook

Initial Language
Other