Easy Tutorial
❮ Jsref Toexponential Prop Table Summary ❯

Video readyState Property

Video Object

Example

Get the ready state of the video:

var x = document.getElementById("myVideo").readyState;
document.getElementById("demo").innerHTML = x;

x Output result:

4 // Indicates that there is enough data to start playing

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 versions do not support this property.


Syntax

Return Value

Type Description
Number Indicates the ready state of the audio/video element: 0 = HAVE_NOTHING - No information whether the audio/video is ready<br>1 = HAVE_METADATA - Metadata about the audio/video is ready<br>2 = HAVE_CURRENT_DATA - Data for the current playback position is available, but not enough to play next frame/millisecond<br>3 = HAVE_FUTURE_DATA - Data for the current and at least the next frame is available<br>4 = HAVE_ENOUGH_DATA - Enough data is available to start playing
❮ Jsref Toexponential Prop Table Summary ❯