readyState property

Gets the current state of the media resource. A media resource in practice is a video and audio element and content.

This property is read-only.

Syntax

JavaScript
state = object.readyState

Property values

Type: ReadyState

The current state of the media resource.

Returns one of the following:

ValueCondition
HAVE_NOTHING
0

No information is available from media resource.

HAVE_METADATA
1

The duration of the media resource is available.

HAVE_CURRENT_DATA
2

Data for the current playback position is available, but not enough to continue playing from this point.

HAVE_FUTURE_DATA
3

Data for the current playback position and data to allow playback to advance a little is available. It usually means the media resource is between the current frame and the following frame.

HAVE_ENOUGH_DATA
4

There is enough data for the playback to continue at the current playback rate without running out of content.

 

See also

media
audio
video
Using JavaScript to control the HTML5 video player
Building a simple MPEG-DASH streaming player

 

 

Show:
© 2014 Microsoft