【问题标题】:Posting And playing SWF videos in fb using Javascript SDK使用 Javascript SDK 在 fb 中发布和播放 SWF 视频
【发布时间】:2015-09-09 12:38:46
【问题描述】:

我正在开发一个 WP 插件来将 WP 帖子发布到 FB。我正在尝试使用 javascript SDK 将从我的网站生成的 SWF 视频发布到 FB。缩略图、说明链接和所有其他内容都已发布。但是当我单击缩略图时,它没有播放视频,而是重定向到链接。播放按钮也没有显示。我正在附上屏幕截图。

我正在附上我的部分代码...

var picture = data.preview_img;
var source = swf_path+'fbap.swf?wpContent='+content+'&bg_clr='+bg_color+'&bg_image='+bg_image+'&font_color='+font_color+'&repeat='+fill_mode+'&video_url='+uid;

     var all_item = {
     method: 'feed',
     type: 'video',
     picture: picture,
     source: source,
     name:'Facebook Dialogs',
     description: 'Using Dialogs to interact with users.'

     }
.................................................................
FB.api('/me/feed', 'post', all_item , function(response) {
                             if (!response || response.error) {
                             alert('Error occured: ' + response.error.message);
                            } else {
                               //Code 
                            }
      }

我也用元标记做到了。

    <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">

作为测试的 Youtube 视频可以正确发布。但它有缓存问题。而且我无法通过大源网址。 有什么解决办法吗?提前感谢您的帮助。

【问题讨论】:

    标签: wordpress actionscript-3 facebook-graph-api apache-flex facebook-javascript-sdk


    【解决方案1】:

    您是否尝试将相同的帖子发布到 FB。它没有任何缓存问题。这是因为您发布的是相同的 WP 帖子。

    为什么不传递大查询字符串而不是传递帖子 ID 并将内容传递给元标记。

    使用这个

     var all_item = {type: 'link',link:'link to the meta tag?id='+postID}
    FB.api('/me/feed', 'post', all_item , function(response) {//Code }
    

    通过$_GET 获取元标记中的内容,然后您就完成了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-14
      • 2011-05-21
      • 2010-11-24
      • 1970-01-01
      相关资源
      最近更新 更多