Sep 13, 2013

Embedding flash in Facebook link posts

If you want to have custom flash movies embeded in Facebook posts that link to your website, like these one from YouTube or SoundCloud:


It's fairly simple. 
BUT, it requires a SSL certificate, so that your website works over HTTPS, without browsers whining about security.

Here's what you do.
You've heard of OpenGraph protocol, right? Right. So, that's all there is to it. Proper metadata in the HTML of your website will instruct Facebook to include your flash movie, like this:
<meta property="og:title" content="Aljažev stolp | Triglav (2864m) | VR panorama"/>
<meta property="og:video" content=""/> 
<meta property="og:type" content="movie"/>
<meta property="og:url" content=""/>
<meta property="og:image" content=""/>
<meta property="og:description" content="VR (virtual reality) panorama pri Aljaževem stolpu na vrhu Triglava. Panorama je posneta brez stativa."/>
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video:width" content="400" />
<meta property="og:video:height" content="300" />

The next part depends on what the flash movie actually does. If it's a movie/music player that fetches media from other sources, or even an other part of your website, you'll need to configure crossdomain.xml. You put that file on the root of your website.

Here's a very liberal example, but fine for testing:
<?xml version="1.0" ?>
<allow-access-from domain="*" />