3

I am using the below array and

$feeddata = array(
                    'type'=>'flash',
                    'method'=>'stream.publish',
                    'display'=>'iframe',
          'link'=> 'https://developers.facebook.com/docs/reference/dialogs/',
          'source'=>'http://www.hackerdude.com/channels-test/swfscout_VideoSample.swf',
         'picture'=> 'http://fbrell.com/f8.jpg',
          'name'=> 'Facebook Dialogs',
          'caption'=> 'Reference Documentation',
          'description'=> 'Using Dialogs to interact with users.');

and passing it to facebook->api($userid.'/feed', 'POST', $feeddata ); But in the feed i can see only the image and when i click in the image it takes me to the link, how can i see swf in the feed (ideally on clicking on the picture it should toggle to swf)

2 Answers 2

6

The type should be "video" instead of "flash". Here's a parameter array that produced a playable video in my tests:

array(
    'type'=>'video',
    'source'=>'http://www.hackerdude.com/channels-test/swfscout_VideoSample.swf',
    'picture'=> 'http://fbrell.com/f8.jpg',
    'name'=> 'Facebook Dialogs',
    'caption'=> 'Reference Documentation',
    'description'=> 'Using Dialogs to interact with users.',
);

Note that there's no link attribute, that's because as it seems to me, the facebook API has a bug at this moment where if you provide a link then it won't embed your video.

The bug theory reinforced by that the JS SDK does indeed accept a link and produce a playable video, you could migrate to this method for publishing if its feasable, with parameters like this:

FB.ui({
     method:'feed',
     type: 'video',
     name: 'Facebook Dialogs',
     link: 'https://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     source: 'http://www.hackerdude.com/channels-test/swfscout_VideoSample.swf',
     description: 'Using Dialogs to interact with users.'
});

Workaround

The embedding seem to be working fine if you post a link that has the proper opengraph meta tags for video embedding, here's an example:

the link to be shared (video brought to you by youtube)

<html>
<head>
    <title>Fly, you fools!</title>
    <meta property="og:title" content="Fly, you fools!" />
    <meta property="og:type" content="website"/>
    <meta property="og:description" content="Content for Description" />
    <meta property="og:image" content="http://i2.ytimg.com/vi/meOCdyS7ORE/mqdefault.jpg" />
    <meta property="og:site_name" content="Content for caption"/>
    <meta property="og:video" content="http://www.youtube.com/v/meOCdyS7ORE?version=3&autohide=1">
    <meta property="og:video:type" content="application/x-shockwave-flash">
    <meta property="og:video:width" content="640">
    <meta property="og:video:height" content="360">
</head>
<body>
<script>
    window.location = 'http://disney.com'; // redirecting users who's clicking on the link, wont affect crawlers since its in js.
</script>
</body>
</html>

php sdk call to share it

$this->facebook->api('/me/feed', 'post', array(
    'type' => 'link',
    'link' => 'http://.../', // put the html file's location here
));
4
  • doing the same thing now, but clicking on the image is taking me to a new tab with the swf open in it , it is not toggling image to swf itself over there.
    – Peter
    Jul 25, 2012 at 14:57
  • 1
    Yes, this is what happens with me too, when posting trough the Graph API, (the name linked to the swf file too) as i wrote. I think its a bug, created a bugreport.
    – complex857
    Jul 25, 2012 at 15:01
  • i posted it , underscore had the problem , a bug from fb side only
    – Peter
    Jul 26, 2012 at 6:37
  • Me too facing same issue when I post to facebook the first thumb will load with flash play button but when I saw it on timeline only link is showing, its not showing any images and flash player Aug 5, 2013 at 12:06
1

write one more met tag : <meta property="og:video:secure_url" content="https://...game url."> "

try to put "https:// " game url ,i.e game swf url with ssl, because fb takes only ssl url to play videos or swf file for game.

Hope this will be useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.