我有这个代码,我用它来使用Graph api安排发布到Facebook的帖子:
$body = array(
'message' => $post->message,
'link' => site_url('index.php/cron/redirect/'.url_encode($post->id_cron)),
'picture' => 'http://img.youtube.com/vi/'.$post->picture.'/0.jpg',
'name' => $post->name,
'caption' => $post->caption,
'description' => $post->description,
'access_token' => $access_token,
'appsecret_proof' => hash_hmac('sha256', $access_token, $this->faceboook->app_secret),
'type' => 'video',
'source' => 'http://www.youtube.com/e/'.$post->picture
);
$relative_url = "/".$post->id_wall."/feed";
$batch = array('method' => 'POST', 'relative_url' => $relative_url, 'body' => http_build_query($body));
$facebook->api('?batch='.urlencode(json_encode($batch)), 'POST');
现在帖子成功发布在组的墙上,链接是正确的,缩略图是正确的,并且它显示为视频,因为小缩略图左下方显示了小播放按钮 . 现在问题是我得到了
"Invalid Error: There was a problem with the parameters of the request"
每当我尝试点击缩略图 . 预期的行动是该帖子将打开一个播放器并在组墙上播放视频 . 这里似乎有什么问题?谁能帮帮我吗?
1 回答
您好,您可以用YouTube视频网址替换您的链接'link' =>“http://www.youtube.com/watch?v=”[YoutubeId];并查看现在显示的视频 .
通常,要将YouTube视频分享到Facebook页面,您只需要消息,链接,来源,图片参数 . 多数民众赞成是如果你使用FacebookC#SDK分享视频到Facebook所有你需要的是遵循代码