0
A
回答
0
看看我的功能定义在这个答案:Listening for Youtube Event in JavaScript or jQuery。
在你的情况下,实现的核心功能,如下所示(小提琴:http://jsfiddle.net/w2w5x/)
// Core functions defined at https://stackoverflow.com/q/7988536#7988536
var player;
YT_ready(function(){
var frameID = getFrameID("YOUR-frame-or-container-ID-here");
if (frameID) { //If the frame exists
player = new YT.Player(frameID, {
events: {
"onStateChange": function(event){
if(event.data == "0") {
//The video has finished
alert("The video has finished!");
//Do something, example: play again
player.playVideo();
}
}
}
});
}
});
相关问题
- 1. 修改YouTube API iframe订阅计数器
- 2. 订阅YouTube API
- 3. Youtube订阅api [错误]
- 4. 动态订阅/取消订阅活动
- 5. Youtube API动态iFrame
- 6. 订阅Spotify活动
- 7. 订阅youtube js
- 8. 取消订阅/订阅活动危险?
- 9. 订阅和取消订阅活动
- 10. YouTube的API不返回所有订阅
- 11. Android Studio和Youtube API订阅者数量?
- 12. YouTube的API - 订阅newsubscriptionvideos发布时间
- 13. ios google + api youtube订阅频道
- 14. 是否有Youtube订阅按钮的API?
- 15. YouTube数据API接收订阅源
- 16. 的YouTube订阅V3
- 17. Youtube Iframe API
- 18. 订阅VBA中的活动?
- 19. 在Global.Asax中订阅活动
- 20. 单次活动订阅
- 21. 尝试与多用户订阅活动订阅并订购它
- 22. 的Youtube iframe的API阻止装载混合活动内容
- 23. Youtube IFrame API without Cookies
- 24. YouTube iframe API Uncaught TypeError
- 25. 使用Youtube Iframe API
- 26. Youtube嵌入iframe API
- 27. youtube iframe api loadVideoById()error
- 28. YouTube IFrame API错误
- 29. Embed Youtube订阅计数器?
- 30. 订阅YouTube频道按钮