如何让这项工作适用于多个视频,我只能使用一个视频
包括:
<script type="text/javascript" src="http://www.youtube.com/player_api"></script>
添加youtube iframe:
<iframe id="player" src="http://www.youtube.com/embed/YOURID?rel=0&wmode=Opaque&enablejsapi=1" frameborder="0"></iframe>
魔术时间:
<script>
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player');
}
// so on jquery event or whatever call the play or stop on the video.
// to play player.playVideo();
// to stop player.stopVideo();
</script>