YouTip LogoYouTip

Prop Video Readystate

HTML DOM Video readyState Property

HTML DOM Video readyState Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

HTML DOM Track Object

HTML DOM Video preload Property

Video readyState Property

Video Object Reference Manual Video Object

Example

Get the ready state of the video:

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

document.getElementById("demo").innerHTML = x;

x output result 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Represents the ready state of the audio/video element:
  • 0 = HAVE_NOTHING - No information about whether the audio/video is ready
  • 1 = HAVE_METADATA - Metadata about the audio/video is ready
  • 2 = HAVE_CURRENT_DATA - Data about the current playback position is available, but not enough data to play the next frame/millisecond
  • 3 = HAVE_FUTURE_DATA - Data for the current and at least the next frame is available
  • 4 = HAVE_ENOUGH_DATA - Available data is sufficient to start playing

Video Object Reference Manual Video Object

HTML DOM Track Object

HTML DOM Video preload Property

ByteDance Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, officially supplied, stable and reliable.

iFlytek Xingchen Coding Plan includes free model call quotas, DeepSeek, GLM, Kimi, MiniMax, one-stop experience and deployment platform. Configuration Guide Β₯3.9/month Subscribe Now

Click to Share Notes

Cancel

← Prop Video SeekableProp Video Preload β†’