通过facebook api在facebook提要中发布swf
我正在使用下面的数组和通过facebook api在facebook提要中发布swf,facebook,facebook-graph-api,post,feed,Facebook,Facebook Graph Api,Post,Feed,我正在使用下面的数组和 $feeddata = array( 'type'=>'flash', 'method'=>'stream.publish', 'display'=>'iframe', 'link'=> 'https://developers.facebook.com/docs/reference/dialogs/',
$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.');
并将其传递到facebook->api($userid.'/feed',POST',$feeddata);
但是在feed中,我只能看到图像,当我点击图像时,它会将我带到链接,我如何在feed中看到swf(理想情况下,点击图片时,它会切换到swf)类型应为“视频”,而不是“flash”。以下是在我的测试中生成可播放视频的参数数组:
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.',
);
注意没有链接
属性,这是因为在我看来,facebook API目前有一个漏洞,如果你提供链接,它就不会嵌入你的视频
JS SDK确实接受链接并生成可播放的视频,这强化了错误理论,如果可行,您可以迁移到该方法进行发布,参数如下:
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.'
});
变通办法
如果您发布了一个链接,其中包含用于视频嵌入的适当opengraph元标记,那么嵌入似乎工作正常,下面是一个示例:
要共享的链接(youtube为您带来的视频)
再写一个met标记:
”
尝试放置“https://”游戏url,即带有ssl的游戏swf url,因为fb只使用ssl url播放视频或游戏swf文件
希望这会有用。现在做同样的事情,但单击图像会将我带到一个新选项卡,其中swf处于打开状态,它不会将图像切换到那边的swf本身。是的,当通过Graph API发布时,我也会这样做,(名称也链接到swf文件)正如我所写。我认为这是一个错误,创建了一个。我发布了它,下划线有问题,一个来自fb方面的错误,我也面临着同样的问题,当我发布到facebook时,第一个拇指将加载flash play按钮,但当我在时间线上看到它时,只有链接显示,它没有显示任何图像和flash播放器
<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>
$this->facebook->api('/me/feed', 'post', array(
'type' => 'link',
'link' => 'http://.../', // put the html file's location here
));