Using Facebook's API to post a video using the feed dialog fails

流过昼夜 提交于 2019-12-21 06:06:17

问题


I'm trying to post a video to a user's timeline using Facebook's feed dialog. When I use the javascript SDK with:

FB.ui({
     method:'feed',
     name: 'testing',
     link: 'http://www.facebook.com',
     picture: 'http://img.youtube.com/vi/1CE6W5BubQo/0.jpg',
     source: 'http://www.youtube.com/watch?v=1CE6W5BubQo'
});

I get:

And this is missing the thumbnail and video player. I tried adding type: 'video' to the parameters and I also tried replacing the source parameter with a direct link to the .swf file, but that didn't help. I'm not sure if this is a bug or if I'm doing something wrong. Any ideas?


回答1:


Do like that:

FB.ui(
  {
    method: 'feed',
    name: 'testing',
    link: 'http://www.facebook.com',
    picture: 'http://img.youtube.com/vi/1CE6W5BubQo/0.jpg',
    //caption: '',
    description: '',
    source: 'https://www.youtube.com/v/1CE6W5BubQo?version=3&autohide=1&autoplay=1'
  },...




回答2:


maybe try this.

change your source

http://www.youtube.com/watch?v=1CE6W5BubQo

into this

https://youtube.googleapis.com/v/1CE6W5BubQo

and

url or link to https://youtube.googleapis.com/v/1CE6W5BubQo




回答3:


This is by design as per facebook --

https://developers.facebook.com/bugs/589975484398226?browse=external_tasks_search_results_526fc388b99e18881434478

I am still trying to figure out a way out of this .



来源:https://stackoverflow.com/questions/20798314/using-facebooks-api-to-post-a-video-using-the-feed-dialog-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!