如何通过应用程序将Flash视频源发布到Facebook页面

时间:2012-03-10 23:22:47

标签: facebook-graph-api facebook-page

我正在尝试将我们的应用程序中的视频发布到Facebook后面的页面api:https://developers.facebook.com/docs/reference/api/page/

但facebook会回复以下回复         {         “错误”:{         “message”:“(#353)缺少视频文件”,         “type”:“OAuthException”,         “代码”:353         }         }

这就是我在浏览器中添加的内容: https://graph-video.facebook.com/ /videos?access_token=&source=https://www.youtube.com/v/ZVKc8KGPKFM&method=post

但它仍然带有相同的消息,有人知道缺少什么吗?感谢

1 个答案:

答案 0 :(得分:2)

这是我将视频链接到Facebook页面的方式。

    $url='https://graph.facebook.com/'.$page_id.'/feed?access_token='.$facebook_page_access_token;

        $args = array(
       'message' => $message,
        'link' => 'http://www.youtube.com/watch?v='.$video_id,
        'source' => 'http://www.youtube.com/e/'.$video_id,
        'picture' => 'http://img.youtube.com/vi/'.$video_id.'/0.jpg'
        );

        $this->_curl = curl_init();

        curl_setopt($this->_curl,CURLOPT_POST,TRUE);  
        curl_setopt($this->_curl,CURLOPT_URL,$url);
        curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $args);
            curl_exec($this->_curl);

确保在参数中添加“source”。否则它将在facebook中显示为普通链接(即post_type = api响应中的链接)

相关问题