Example
Check if video is paused:
myVid=document.getElementById("video1"); alert(myVid.paused);
Definition and usage
paused attribute returns audio/video Has it been paused?
Browser support
All major browsers support the paused attribute.
Note: This attribute is not supported in Internet Explorer 8 or earlier browsers.
Syntax
audio|video.paused
Return value
Type | Description |
Boolean value | true|false. true indicates that the audio/video is paused. Otherwise false. |
Example
Check if the video is paused:
<!DOCTYPE html> <html> <body> <p> <button onclick="getNWState()" type="button">获得网络状态</button> </p> <video id="video1" controls="controls" autoplay="autoplay"> <source src="/kf51/demo/mov_bbb.mp4" type="video/mp4"> <source src="/kf51/demo/mov_bbb.ogg" type="video/ogg"> 您的浏览器不支持 video 标签。 </video> <script> var myVid = document.getElementById("video1"); function getNWState() { alert(myVid.paused); } </script> </body> </html>
The above is the detailed content of The attribute paused that returns whether the audio/video has been paused in html5. For more information, please follow other related articles on the PHP Chinese website!