以编程方式将 YouTube 视频添加到墙贴
如何在 Facebook 墙上嵌入 YouTube 视频?我尝试使用“源”成员传递视频网址,但没有成功。在检查手动发布的提要的 json 后,我发现 FB 的服务器代码进行了一些处理来实现这一点。
该提要向我展示了这一点:
"id": "100001460921297_170524112986785",
"from": {
"name": "Fw As",
"id": "100001460921297"
},
"message": "In SBSR 16 July 2010 Portugal",
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=9f79134b5acff03a2d60adb0320dbc8b&w=130&h=130&url=http%3A%2F%2Fi.ytimg.com%2Fvi%2FTOypSnKFHrE%2F0.jpg",
"link": "http://www.youtube.com/watch?v=TOypSnKFHrE",
"source": "http://www.youtube.com/v/TOypSnKFHrE&autoplay=1",
"name": "The Strokes - Last Nite",
"caption": "www.youtube.com",
"description": "Music video by The Strokes performing Last Nite. (C) 2001 BMG",
"icon": "http://static.ak.fbcdn.net/rsrc.php/yj/r/v2OnaTyTQZE.gif",
有没有办法通过 c# sdk 实现此目的?到目前为止我找不到任何有用的信息。
有什么想法吗?
谢谢,圣诞快乐!
How can i embeded an youtube video in the facebook wall? I tried to pass the video url using the "source" member, but didn't work. After checking the json of a feed posted manually i see that there is some handling by FB's server code to make it happen.
The feed shows me this:
"id": "100001460921297_170524112986785",
"from": {
"name": "Fw As",
"id": "100001460921297"
},
"message": "In SBSR 16 July 2010 Portugal",
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=9f79134b5acff03a2d60adb0320dbc8b&w=130&h=130&url=http%3A%2F%2Fi.ytimg.com%2Fvi%2FTOypSnKFHrE%2F0.jpg",
"link": "http://www.youtube.com/watch?v=TOypSnKFHrE",
"source": "http://www.youtube.com/v/TOypSnKFHrE&autoplay=1",
"name": "The Strokes - Last Nite",
"caption": "www.youtube.com",
"description": "Music video by The Strokes performing Last Nite. (C) 2001 BMG",
"icon": "http://static.ak.fbcdn.net/rsrc.php/yj/r/v2OnaTyTQZE.gif",
Is there way to achieve this via the c# sdk? I couldn't find any info helpfull about it so far.
Any ideas?
Thanks and merry christmas!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Facebook C# SDK,那么在成功进行身份验证和授权后,您需要发布链接。
我假设 _FacebookApp 是 FacebookApp 类的实例并且您已获得授权,那么代码将是:
其中 Commentary 是用户关于此链接的可选消息,例如:“伙计们,检查一下”,
Link 是共享的 URL ,例如:“http://www.youtube.com/watch?v=_OBlgSz8sSM”,
ThumbnailImageUrl 是链接帖子中使用的缩略图的 URL,例如:“http://i.ytimg.com/vi/ _OBlgSz8sSM/0.jpg”。
希望它会有所帮助。
干杯。
If you use Facebook C# SDK, then after successful authentication and authorization you need to post a link.
I assume that _FacebookApp is instance of FacebookApp class and you are authorized, then the code will be:
where Commentary is an optional message from the user about this link, e.g.: "Guys, check it out",
Link is the URL that was shared, e.g.:"http://www.youtube.com/watch?v=_OBlgSz8sSM",
ThumbnailImageUrl is a URL to the thumbnail image used in the link post, e.g.:"http://i.ytimg.com/vi/_OBlgSz8sSM/0.jpg".
Hope it will help.
Cheers.