问题
How can I check status of a HTML5 vide element? I need to toggle play/pause the video element.
回答1:
There are few methods like below,
var myVideo=document.getElementById("video1");
if (myVideo.paused) {
myVideo.play();
}
else {
myVideo.pause();
}
have a look at complete working example here.
来源:https://stackoverflow.com/questions/14331670/check-if-a-html5-video-element-is-playing