I previously posted a tutorial on embedding YouTube videos or other Flash objects (SWFs) in a Facebook Fan Page with Static FBML. So how do you embed Vimeo videos in your Static FBML box?
UPDATE: August 18, 2010:
It appears Vimeo has moved on from Flash to HTML5 for their embedded videos, for compatibility with iPads & iPhones: http://vimeo.com/blog:334. It's called "Universal Player." Says Vimeo: "We are not discontinuing the old embed code and as long as you use the sharing buttons in the Share box or the auto-share, sharing to these sites will work."
To deal with this you'll need to get the new URL from Vimeo. After selecting the video, click the "Embed" icon, then click on the "old embed code" link:

Grab that embed code from the screen displayed. Get the URL for the "swfsrc" from <param name="movie" value="USE THIS URL" .... />. If you want the video to autoplay after the user clicks the activation image, change "autoplay=0" to "autoplay=1" in the URL code. It should work fine.
(End Update)
PLEASE NOTE: If you can’t get it working, make sure:
- The URLs to both the activation image (imgsrc) and the video are correct. You can test them by pasting the URL into your browsers address bar and accessing the image or video channel directly. If you can’t access them via this method, your URL is incorrect.
- You have closed the <fb:swf> tag, with "/>". If the tag isn’t closed, it won’t work.
- All quotes are closed. It doesn’t matter if they’re single (‘) or double (“), but they must match and they must be closed (width=’xxx’ or width=”xxx” – NOT width=’xxx or width=”xxx or width="xxx' ).
Embedding your Vimeo videos in Static FBML
- Go to Vimeo and locate the video you wish to embed in your Static FBML box.
- When you mouse over the video image, you'll see the option to "embed" — click the "Embed" button:
- Copy the embed code. From this code copy the value for "embed src" (highlighted in blue, below):
- Paste this value into "swfsrc" in the FBML code for embedding the object:
Here's the code you put on your Static FBML page:<fb:swf
swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;"
swfsrc='http://vimeo.com/moogaloop.swf?clip_id=1658217&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1'
imgsrc='http://img.youtube.com/vi/xxxxxxxxxx/2.jpg' width='400' height='302' />
The "imgsrc" parameter is the source for an "activation" image to load the video. Facebook requires this "user action" before it will load JavaScript or Flash on a Fan Page application tab such as Static FBML.
For the "imgsrc" value, you can point this URL to an image you have hosted on a Web server, or to the image Vimeo uses to identify the video, which would be the image you clicked on the get to the video's page.
To see this image's URL, just right-click it and select "View Image" (Firefox or Safari) from the popup window, and you'll see the image URL in the browser address bar at the top of your browser:

If you use Internet Explorer, right-click the image, select "Properties" from the popup window, and you'll see the image URL value in "Address (URL)".
Your final code would look like this:
<fb:swf
swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;"
swfsrc='http://vimeo.com/moogaloop.swf?clip_id=1658217&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1'
imgsrc='http://images.vimeo.com/12/97/71/129771927/129771927_200x150.jpg' width='400' height='302' />
The video's width and height values are also in the original embed code you copied from the Vimeo site, in the <embed src= ...> tag.
Copy the above code into your Static FBML page. It should work.
If you can't see the activation image (imgsrc) or the video, check the URLs by pasting them into your browser address bar to access the image or video directly. If you the URLs don't resolve to the intended files, then you've probably copied them incorrectly.



#1 by Karen - April 6th, 2010 at 09:19
Is it possible to embed multiple vimeo videos through the static FBML page? I've been able to embed one video I just cannot figure out how to do more than one.
#2 by timware - April 6th, 2010 at 09:26
Sure. Just repeat the code described above. Should work for multiple instances.
#3 by Heidi - August 5th, 2010 at 01:52
Thanks for thinking of the vimeo option. I put this code onto a FBML page. The image appears, if you click it you get the sound of the video but not the visual. Also, no play button.
thanks!
#4 by Andrew - April 8th, 2010 at 08:08
Great tutorial! What about embedding the RSS feed of videos to facebook? Is it possible to embed multiple videos within the same interface? So a user could just scroll to the left and right and select other videos from the same feed?
#5 by timware - April 8th, 2010 at 08:44
If you're referring to adding a Vimeo channel, I haven't yet researched that. You might start with the tutorial on embedding YouTube channels in a Static FBML box/tab.
#6 by Emily - April 22nd, 2010 at 12:37
I've embedded some vimeo videos into static FBML but when I click on the image, it then loads the acutal embedded video and I have to click play again. Is there a way to get it to play from only one click?
#7 by timware - April 23rd, 2010 at 08:20
Emily: You might try adding &autoplay=1 to the "swfsrc" parameter, like this:
swfsrc='http://vimeo.com/moogaloop.swf?clip_id=1658217&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1&autoplay=1'
Let me know if that works for you.
#8 by Carmen - May 3rd, 2010 at 02:59
Much props to you for writing this article, I had been looking and looking for information on how to embed a vimeno video specially, in Facebook. Thank you sooooo much, you Rock!!!!! I will totally join your RSS feed. Good tutorial, I followed it to a "T".
#9 by Shahnur Arefin - June 9th, 2010 at 09:57
Thanks for the nice tutorial. But I need to know a little thing, How embed a mp3 flash player in facebook fanpage using FBML. Here is a link for all of you.
http://www.facebook.com/usher?ref=ts
They used a mp3 player which is somehow embed in fbml. Not the normal fb:mp3. please need help for someone. Email: msn_arefin@yahoo.co.uk
thank you all.
#10 by timware - June 9th, 2010 at 18:11
Well, it's a SWF file, so I'd try using the instructions for embedding video or Flash in Static FBML right here on this blog.
#11 by Thomas M. - June 21st, 2010 at 15:55
great tutorial!
quick question. is there any way to make the imgsrc
a different size than the swfsrc?
#12 by timware - June 21st, 2010 at 15:57
Not that I'm aware of.
#13 by raju - June 22nd, 2010 at 21:33
i have put the below code on my facebook application and this loads the video fine on IE, but does not load on any other (FF, Safari, Netscape) browsers. Can u pls help me, if we need any other adjustments needed in the code to make it work?
<fb:swfswfbgcolor="000000" imgstyle="border-width:3px; border-color:white;" swfsrc='http://vimeo.com/moogaloop.swf?clip_id=XXXXXX&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1'
imgsrc='http://mysite-xyz.com/images/img_xyz.jpg' width='490' height='275' />
#14 by timware - June 22nd, 2010 at 21:50
The code appears well formed, but since you x'd out the values where I could actually test if the URLs for swfsrc and imgsrc are valid, I can't check those.
#15 by raju - June 22nd, 2010 at 21:55
ok here are the correct values embeded in code
code>#16 by raju - June 22nd, 2010 at 21:56
here are the valid codes...
<fb:swf
swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;" swfsrc='http://vimeo.com/moogaloop.swf?clip_id=11494781&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1'
imgsrc='http://s83424.gridserver.com/artstarstab/images/pam_video_img.jpg' width='490' height='275' />
#17 by timware - June 22nd, 2010 at 22:04
I tested your code and it works fine, so I'm not sure what your problem is. I'm using Firefox on a Mac and it worked just fine.
#18 by Alex - August 6th, 2010 at 14:21
Phenomenal tutorial, just what I was looking for!
I have everything working on a fan page, but when the Vimeo video is playing, the full screen button just pauses the video.
I've tried adding '&fs=1' and '&fullscreen=1', but have had no luck.
Here's my code:
#19 by timware - August 6th, 2010 at 14:48
Unfortunately, Facebook doesn't support the full-screen mode for videos.
#20 by Alex - August 6th, 2010 at 14:52
That's lame. The in-house Facebook video player supports it..
#21 by dennis - August 9th, 2010 at 07:08
Hey, what will I do if I want to see my videos also on an iPad?
I found no reference for html5 in general or h264 support for apple devices in special on facebook developer.
any hint is very welcome.
thnx
Dennis
#22 by dennis - August 9th, 2010 at 07:13
sorry, just to complete my post and question with some info:
yes, Facebook claims since April they provide a browser detection for mobile safari and deliver h264 to those clients...
but how can they do that, if your original source of video stream is YouTube or Vimeo? They cant cache/transcode these streams because they are simply not their domain.
Testing this during the passed days, I can commit that FB is not doing such things. They send Flash to my iPhone and iPad...
Dennis
#23 by timware - August 9th, 2010 at 08:31
There are applications available that convert YouTube, Vimeo and other video files to iPad/iPhone/iTouch compatible formats.
Windows iPad Video Converter
(free trial, then $24.95 unlimited, one-time)
Mac OS X iPad Video Converter (free)
I haven't seen evidence that Facebook is converting Flash video to iPad-compatible format.
#24 by Christopher - August 17th, 2010 at 11:05
Fantastic Post! Thorough instructions.
Is it tough to incorporate an image behind the video and imgsrc? I would love to skin the backend. Or maybe place an image above and below the video.
Thanks so much for sharing the knowledge!
#25 by timware - August 17th, 2010 at 11:17
It's easy to put your video & imgsrc inside a DIV that has a background image. Make sure you're using external stylesheets. Just style the containing DIV using CSS.
#26 by John - August 18th, 2010 at 07:03
I used your code and worked perfectly, until today.. apparently vimeo changed the player so its not working anymore, any thoughts?
#27 by timware - August 18th, 2010 at 07:48
It appears Vimeo has moved on from Flash to HTML5 for their embedded videos, for compatibility with iPads & iPhones: http://vimeo.com/blog:334. It's called "Universal Player." Says Vimeo: "We are not discontinuing the old embed code and as long as you use the sharing buttons in the Share box or the auto-share, sharing to these sites will work."
To deal with this, after clicking the "Embed" icon, click on the "old embed code" link and grab that embed code from the screen displayed. Get the URL for the "swfsrc" from <param name="movie" value="USE THIS URL" .... />. If you want the video to autoplay after the user clicks the activation image, change "autoplay=0" to "autoplay=1" in the URL code. It should work fine.
#28 by Reilly - August 20th, 2010 at 07:04
<fb:swf
swfbgcolor="000000" imgstyle="border-width:3px; border-color:white;"swfsrc='http://vimeo.com/moogaloop.swf?clip_id=14271115&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=ffffff&fullscreen=1&loop=0&&autoplay=1' imgsrc='http://ats.vimeo.com/834/405/83440563_100.jpg'width='475' height='350' />
#29 by Takana - August 31st, 2010 at 22:39
Ive just uploded some vimeo videos but the embed code doesnt include moogaloop code. its just player.vimeo.com/video/xxxxxxx (x are numbers)
so what do we do now?
#30 by Takana - August 31st, 2010 at 22:41
Ive just red the last comment. thank you my problem is solved
#31 by Reilly - August 20th, 2010 at 07:03
And for clarification I would like the video to play when they get to the page without having to click the image...if thats possible.