我想知道是否有可能嵌入youtube视频的评论和喜欢按钮与视频? 如果有这样的事情,我该怎么做,或者我可以从哪里获得更多信息?由于嵌入youtube的评论,并像
2
A
回答
0
您可以通过处理此URL
http://gdata.youtube.com/feeds/api/videos/{$videoID}/comments
一样的功能YouTube的访问YouTube的评论需要将登录到他/她的谷歌帐户的用户
2
在这里你可以看到一个例如,如何获取和显示视频评论
Getting Youtube Video Information using javascript/jquery
,并在主题浏览器项目,你可以看到如何添加 '喜欢' 或视频添加到您的收藏夹:
https://code.google.com/p/yt-topic-explorer/source/browse/app/views/main.html
<button ng-click="addToList($event.target, 'likes', videoResult.id)">{{'LIKE'|i18n}}</button>
<button ng-click="addToList($event.target, 'favorites', videoResult.id)">{{'FAVORITE'|i18n}}</button>
和:
https://code.google.com/p/yt-topic-explorer/source/browse/app/scripts/controllers/main.js
$scope.addToList = function(target, listName, videoId) {
var listId = $rootScope.relatedPlaylists[listName];
target.textContent = topicExplorerApp.filter.i18n('ADDING');
target.disabled = true;
youtube({
method: 'POST',
service: 'playlistItems',
params: {
part: 'snippet'
},
body: {
snippet: {
playlistId: listId,
resourceId: {
kind: constants.VIDEO_KIND,
videoId: videoId
}
}
},
callback: function(results) {
if ('error' in results) {
target.textContent = 'Error';
} else {
target.textContent = topicExplorerApp.filter.i18n('ADDED');
}
}
});
};
1
编辑: 2016年2月,YT已经停止了解决方案以下工作:-(我会保留它这里仅作参考
的意见:
作为YT已经过时的意见网址GDATA,你也可以凑“时间从这里开始;其解决方法虽然:D
https://www.youtube.com/all_comments?v=cOIKAnF3mjs
...无需认证! :)如果你想工作的客户端仅(在这个例子中通过跨域),经过JS
<textarea style="width:100%;height:100%" id=cu></textarea>
<script>
var r='';
function c(d)
{
for(i=0;i<=d.query.count-1;i++)
r=r+d.results[i];
document.getElementById('cu').innerHTML=r;
}
</script>
<script src="http://query.yahooapis.com/v1/public/yql?q=%20SELECT%20*%20FROM%20html%20WHERE%20url%3D%22https://www.youtube.com/all_comments?v=cOIKAnF3mjs%22&callback=c"></script>
1
YouTube不会有,您可以使用嵌入任何评论嵌入代码。所以基本上有两个选项来嵌入评论 -
1.使用YouTube API来嵌入和发表评论。这将需要一个良好的编码知识。
获得评论使用此终结
GET https://www.googleapis.com/youtube/v3/commentThreads
添加注释使用此终结
POST https://www.googleapis.com/youtube/v3/playlistItems
2.或者你可以使用现成的插件,允许这项功能。这里是一个小的demo of the Youmax plugin,它将列出评论以及允许您添加评论。
相关问题
- 1. 在网页中嵌入Youtube评论
- 2. 评论评论标记(嵌套评论)
- 3. Java Youtube API评级评论
- 4. 在评论或消息中嵌入youtube或vimeo视频,如Facebook
- 5. 的Android YouTube的评论API
- 6. Youtube API V3插入评论问题
- 7. 的YouTube API评论Feed
- 8. 评价(like/dislike)YouTube的评论
- 9. 批量 - 在YouTube上评论
- 10. YouTube API评论流媒体
- 11. 回复评论YouTube风格
- 12. Upvote Youtube评论随着API
- 13. 检索Youtube评论OAuth 2.0
- 14. 评论限制和嵌套评论
- 15. 在mongodb中嵌入的评论分页
- 16. Jinja2内嵌评论
- 17. Pregreplace youtube嵌入图像
- 18. 嵌入XML在SVN消息(评论)
- 19. 如何嵌入Google Plus撰写评论
- 20. 在VB.NET中嵌入LINQ评论
- 21. 在mongodb中嵌入评论搜索
- 22. 如何使用YouTube .NET API投票/评论评论?
- 23. youtube API v3 - 比率(喜欢/不喜欢)评论/评论线程?
- 24. 将WordPress评论与Facebook评论合并
- 25. 实现在angularjs中嵌入评论像Twitter一样
- 26. 如何实施YouTube的评论功能?
- 27. 如何检索YouTube视频的评论
- 28. 如何禁用的YouTube API V3评论
- 29. 的Youtube API V3添加喜欢评论
- 30. iOS GData对视频的YouTube评论
你在用什么语言? – 2012-03-15 15:12:29