js 监听音频视频控件是否播放

监听onplaying:

var myVideo=document.getElementById("video1");
myVideo.addEventListener("playing", function(){
     console.log("playing");
//     video(this.src);
 });
 myVideo.addEventListener("pause", function(){/     
    console.log("paused")
 });

<video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" width="550" height="400" loop="true" controls="" autobuffer="" id="video1" onplaying="getVideo()">

 

posted @ 2017-10-11 16:31  Redchar  阅读(4245)  评论(0编辑  收藏  举报