Video readyStateProperty
Examples
Get the video's ready state:
var x = document.getElementById("myVideo").readyState;
document.getElementById("demo").innerHTML = x;
document.getElementById("demo").innerHTML = x;
xThe output is:
4 // indicates there is enough data to start playing
Try it Yourself »
Definition and Usage
The readyState property returns the current ready state of the video.
The ready state indicates whether the audio/video is ready to play.
Note:This property is read-only.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the readyState property.
Note:Internet Explorer 8 or earlier browsers do not support this property.
Syntax
videoObject.readyState
Return Value
| Type | Description |
|---|---|
| Number |
Indicates the ready state of the audio/video element:
|
Video Object Other Extensions