Video readyState attribute

Definition and usage

readyState The property returns the current ready state of the video.

The ready state indicates whether the video can be played.

Note:This property is read-only.

Example

Get the current ready state of the video:

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

Try it yourself

Syntax

videoObject.readyState

Return value

Type Description
Number

Indicates the ready state of the video element:

  • 0 = HAVE_NOTHING - No information about whether the video is ready
  • 1 = HAVE_METADATA - The video metadata is ready
  • 2 = HAVE_CURRENT_DATA - Data at the current playback position is available, but there is not enough data to play the next frame/millisecond
  • 3 = HAVE_FUTURE_DATA - Current and at least the next frame of data is available
  • 4 = HAVE_ENOUGH_DATA - There is enough available data to start playback

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 9.0 Support Support Support