Post swf with parameters to facebook via application

Go To StackoverFlow.com

0

I have a facebook application where the user choose 4 of his friends and then it creates a video (swf) with the pictures of your friends in it (loaded via xml). So I need to share this video on the user timeline. Everything works fine but the video is not embedded in the post on his timeline, there is only a post with the link to the page in it.

The weird thing is, if I post the url directly on my timeline, the video is embedded, but not if the same link is posted via the application.

here is my code called by the share button in js :

function postToFeed() {
    var obj = {
      method: 'feed',
      link: 'https://mysite.com/flash/share-page.php?id=22',
      picture: 'https://mysite.com/images/video-preview.jpg',
      name: 'Name',
      caption: 'Caption',
      description: 'Description'
    };

    function callback(response) {
      //some code here
    }

    FB.ui(obj, callback);
  }

and the code in my share-page.php

<?php

$id_inscription = $_GET['id'];

$video_url = 'https://mysite.com/flash/share-page.php?id=22';
$video_preview_image = 'https://mysite.com/images/video-preview.jpg';

?>

<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="en">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<meta property="og:video" content="<?php echo $video_url; ?>"/>

<!-- Open grah tags for Facebook -->
<meta property="og:title" content="Test video player" />
<meta property="og:description" content="A video player interface experiment." />
<meta property="og:type" content="video" />
<meta property="og:url" content="<?php echo $video_url; ?>"/>
<meta property="og:image" content="<?php echo $video_preview_image; ?>"/>
<meta property="og:site_name" content="Site name"/>

<!-- Video specific open graph tags -->
<meta property="og:video" content="<?php echo $video_url; ?>" />
<meta property="og:video:secure_url" content="<?php echo $video_url; ?>" /> <!-- Required for people on Facebook who have secure browsing enabled! -->
<meta property="og:video:width" content="325" />
<meta property="og:video:height" content="180" />
<meta property="og:video:type" content="application/x-shockwave-flash" />


<script src="js/swfobject.js"></script>
<script>
    var flashvars = {
        xmlUrl:"xml/data-<?php echo $id_inscription; ?>.xml",
        policyFileUrl:"http://profile.ak.fbcdn.net/crossdomain.xml"
    };
    var params = {
        menu: "false",
        scale: "noScale",
        allowFullscreen: "true",
        allowScriptAccess: "always",
        bgcolor: "",
        wmode: "opaque"
        //wmode: "direct" // can cause issues with FP settings & webcam
    };
    var attributes = {
        id:"content"
    };
    swfobject.embedSWF(
        "app.swf",
        "altContent", "480", "270", "10.0.0",
        "expressInstall.swf",
        flashvars, params, attributes);
</script>
</head>

<body>
<div id="altContent">
    <p><a href="http://www.adobe.com/go/getflashplayer">Get Adobe Flash player</a></p>
</div>
</body>

</html>
2012-04-04 19:35
by Alex Beauchemin


0

Found it, in the javascript you have to add

source: 'https://mysite.com/flash/app.swf'
2012-04-05 13:49
by Alex Beauchemin


0

DOesnt work for me . Also facebook says ,It is NOT supposed to work By Design .

https://developers.facebook.com/bugs/589975484398226?browse=external_tasks_search_results_526fc388b99e18881434478

Please share here your code snippet if you could make it work . I have the meta tags taking care for the secure video Url as well .

2014-04-26 04:47
by Vikash Singhal
Ads