javascript - You tube video api, stop a video -
how make work more 1 video , got work 1 video
include:
<script type="text/javascript" src="http://www.youtube.com/player_api"></script>
add youtube iframe:
<iframe id="player" src="http://www.youtube.com/embed/yourid?rel=0&wmode=opaque&enablejsapi=1" frameborder="0"></iframe>
magic time:
<script> var player; function onyoutubeplayerapiready() { player = new yt.player('player'); } // on jquery event or whatever call play or stop on video. // play player.playvideo(); // stop player.stopvideo(); </script>
Comments
Post a Comment