Check if element plays HTML5 video

How to check the status of an HTML5 element? I need to switch play / pause item of video.

+6
source share
1 answer

There are several methods as shown below.

var myVideo=document.getElementById("video1"); if (myVideo.paused) { myVideo.play(); } else { myVideo.pause(); } 

see the full working example here .

+17
source

All Articles