FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

Video readyState Property

Video Object Reference Video Object

Example

Get the current ready state of the video:

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

The result of x could be:

4 // Indicates that there is enough data available to start playing
Try it Yourself »

Definition and Usage

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

The ready state indicates if the video is ready to play or not.

Note: This property is read-only.


Browser Support

Property
readyState Yes 9.0 Yes Yes Yes

Syntax

videoObject.readyState

Return Value

Type Description
Number Represents the ready state of the video element:
  • 0 = HAVE_NOTHING - no information whether or not the video is ready
  • 1 = HAVE_METADATA - metadata for the video is ready
  • 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
  • 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
  • 4 = HAVE_ENOUGH_DATA - enough data available to start playing

Video Object Reference Video Object