如果我暂停了youtube视频加载,该怎么办?
暂停视频后,视频加载进度条也会停止。
<iframe width="560" height="315" src="https://www.youtube.com/embed/Ggh_y-33Eso" frameborder="0" allowfullscreen></iframe>
答案 0 :(得分:0)
You may want to review through the Youtube JavaScript API Reference docs.
When you embed your video(s) on the page, you will need to pass this parameter:
http://www.youtube.com/v/VIDEO_ID?version=3&enablejsapi=1
If you want a stop all videos button, you can setup a javascript routine to loop through your videos and stop them:
player.stopVideo()
This does involve keeping track of all the page IDs for each video on the page. Even simpler might be to make a class and then use jQuery.each.
$('#myStopClickButton').click(function(){
$('.myVideoClass').each(function(){
$(this).stopVideo();
});
});