Facebook 发布视频流 + PHP
我正在使用下面的代码在 Facebook 墙上发布 flv 文件。
$description=$imgdetails;
$href="http://www.abc.net";
$src="http://www.abc.net/test.flv";
$attachment = array(
'name' => $name,
'href' => $href,
'description' => $description,
'media' => array(array('type' => 'video',
'video_src' => "http://www.abc.com/test.flv",
'preview_img' => 'http://www.abc.com/logo.png',
'href' => $href)));
$action_links = array( array('text' => 'Visit Us', 'href' => 'http://www.abc.com'));
$attachment = json_encode($attachment);
$action_links = json_encode($action_links);
$target_id = "********";
if( $facebook->api_client->stream_publish($message, $attachment, $action_links)) {
echo "Added on FB Wall";
}
上面的代码成功地将视频发布到 Facebook 墙上,但是当我尝试播放视频时,即使视频文件存在于指定的 URL 上,也没有任何反应。我做错了什么?
提前致谢。
I'm using below code to publish a flv file on Facebook wall.
$description=$imgdetails;
$href="http://www.abc.net";
$src="http://www.abc.net/test.flv";
$attachment = array(
'name' => $name,
'href' => $href,
'description' => $description,
'media' => array(array('type' => 'video',
'video_src' => "http://www.abc.com/test.flv",
'preview_img' => 'http://www.abc.com/logo.png',
'href' => $href)));
$action_links = array( array('text' => 'Visit Us', 'href' => 'http://www.abc.com'));
$attachment = json_encode($attachment);
$action_links = json_encode($action_links);
$target_id = "********";
if( $facebook->api_client->stream_publish($message, $attachment, $action_links)) {
echo "Added on FB Wall";
}
above code successfully post the video on Facebook wall but when i try to play the video nothing happens even video file exist on specified URL. What am doing wrong ?
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将视频链接发布到 Facebook 而不是视频。
对于视频上传,请使用 video.upload 方法。这样,只会上传链接,不会上传视频。
you are posting link of video to fb instead of video.
For video upload use video.upload method. This way only link will be uploaded not video.
以下是如何使用新的 Graph API 将视频上传到 Facebook 的示例:http://developers.facebook.com/blog/post/493/
有关详细文档:http://developers.facebook.com/docs/reference/api/video/
Here is an example how to upload video to facebook using the new Graph API: http://developers.facebook.com/blog/post/493/
For detailed documentation: http://developers.facebook.com/docs/reference/api/video/