如何使用 JavaScript SDK 共享视频?
我正在使用 FB.ui 来允许用户将某些内容分享到他们的墙上。它工作得很好,但我希望我可以分享一个视频 - 就像你可以使用开放图标签一样。这是我当前的代码:
$('#share').click(function() {
FB.ui(
{
method: 'feed',
name: 'App name',
link: 'http://www.facebook.com/pages/mypage',
picture: 'http://url.com/picture.jpg',
caption: 'Type in a caption',
description: 'A description of the share',
});
});
使用 Open Graph 标签,您可以执行以下操作:
<meta property="og:video" content="https://url.com/video.swf" />
<meta property="og:video:height" content="259" />
<meta property="og:video:width" content="398" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:image" content="https://url.comimage.jpg"/>
当 Facebook 抓取您的页面时,他们将图像放在带有“播放”按钮的共享帖子中,然后当您单击它时,SWF 将显示。
这可以通过 JS SDK 实现吗?
谢谢
I'm using FB.ui to allow users to share something to their wall. It works fine, but I was hoping I could share a video - like you can do with the Open Graph tags. Here is my current code:
$('#share').click(function() {
FB.ui(
{
method: 'feed',
name: 'App name',
link: 'http://www.facebook.com/pages/mypage',
picture: 'http://url.com/picture.jpg',
caption: 'Type in a caption',
description: 'A description of the share',
});
});
With the Open Graph tags you can do the following:
<meta property="og:video" content="https://url.com/video.swf" />
<meta property="og:video:height" content="259" />
<meta property="og:video:width" content="398" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:image" content="https://url.comimage.jpg"/>
When Facebook scrapes your page, they put the image in the shared post with a "play" button, then when you click it the SWF shows up.
Is this doable with the JS SDK?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题很老了,但答案如下:
更多信息此处。
The question is old, but here's the answer:
More information here.