Facebook Open Graph:发布操作时视频未显示



这类似于之前的问题,但现在我想在从网页发布操作时包含 youtube 视频,而不是从移动设备上的提要对话框发布。

我下面的代码基于官方的Facebook教程。我根据另一个Facebook文档页面添加了视频元标记。我已经对应用程序进行了身份验证,单击"发布"按钮时收到了成功警报框。但是,当我转到 https://www.facebook.com/[我的用户名]/活动/[我的操作ID]时,帖子显示标题,URL和描述正常,但我没有看到视频缩略图...

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# [MY NAMESPACE]: http://ogp.me/ns/fb/[MY NAMESPACE]#">
  <meta property="fb:app_id" content="[MY APP ID]" /> 
  <meta property="og:type"   content="[MY NAMESPACE]:[MY OBJECT]" /> 
  <meta property="og:url"    content="[MY LINK]" /> 
  <meta property="og:title"  content="Sample Object" /> 
  <meta property="og:image" content="http://i4.ytimg.com/vi/k86xpd26M2g/hqdefault.jpg">
  <meta proprety="og:video" content="http://www.youtube.com/v/=yO7B9ERbqdY" />
  <meta property="og:video:secure_url" content="https://www.youtube.com/v/yO7B9ERbqdY" />
  <meta property="og:video:type" content="application/x-shockwave-flash">
  <meta property="og:video:width" content="398">
  <meta property="og:video:height" content="224">
  <meta property="og:site_name" content="YouTube">
  <meta property="og:description" content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis eros metus. Etiam vehicula, eros quis     ultrices pulvinar, sapien orci malesuada sem, malesuada hendrerit lacus massa nec eros. Nullam eget volutpat nunc. Phasellus quis mattis massa. Sed     dolor lacus, rhoncus ut imperdiet ut, euismod eu ipsum." />
  <script type="text/javascript">
  function postDialog()
  {
    FB.api(
     '/me/[MY NAMESPACE]:[MY ACTION]',
     'post',
     { dialog: '[MY OBJECT URL]' },
     function(response) {
       if (!response || response.error) {
          alert("Error Type: " + response.error.type + "nnMessage: " + response.error.message);
        } else {
          alert('Cook was successful! Action ID: ' + response.id);
        }
      }
    );
  }
  </script>
</head>
<body>
  <div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '[MY APP ID]', // App ID
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true, // parse XFBML
        oauth      : true,
      });
    };
    // Load the SDK Asynchronously
    (function(d){
      var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js";
      d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
  </script>
  <form>
    <input type="button" value="Post" onclick="postDialog()" />
  </form>
</body>
</html>

问题:

1)我做错了什么?如何让视频在帖子中显示?

2)稍微不相关的问题:我的帖子只显示在我个人资料页面的"最近活动"中,因此不显示描述文本,但我真的希望该帖子在我的时间线中作为一个单独的帖子。这是否与我尚未提交此活动以供批准有关?

整个下午和晚上都在努力摔跤......提前非常感谢!

您的og:url指向 youtube,它应该指向元标记所在的同一页面

最新更新