HTML Audio/Video DOM readyState Property

❮ HTML Audio/Video DOM Reference

Example

var vid = document.getElementById("myVideo");

function myFunction() {
  alert(vid.readyState);
}

Meaning

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


Standard Syntax

audio|video.readyState



Browser Support




Status







Return Value

Type Description
number Returns the ready state of the audio/video element:
  • 0: HAVE_NOTHING - no information whether or not the audio/video is ready.
  • 1: HAVE_METADATA - metadata for the audio/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.
❮ HTML Audio/Video DOM Reference