Javascript examples for DOM HTML Element:Video
The readyState property returns the current ready state of the video.
This property is read-only.
Type | Description |
---|---|
Number | Represents the ready state of the video element: |
The following code shows how to get the current ready state of the video:
<!DOCTYPE html> <html> <body> <video id="myVideo" width="320" height="240" controls> <source src="your.mp4" type="video/mp4"> <source src="your.ogg" type="video/ogg"> Your browser does not support the video tag. </video>// www . ja va2s . com <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myVideo").readyState; document.getElementById("demo").innerHTML = x; } </script> </body> </html>