Track readyState attribute

Definition and usage

readyState The property returns the current readiness status of the track resource.

The readiness status indicates whether the resource is ready to play.

Note:This property is read-only.

Example

Get the current readiness status of the track resource:

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

The result of x could be:

2 // Indicates that the text track is loaded and there are no errors

Syntax

trackObject.readyState

Technical details

Return value:

Value indicating the readiness status of the track resource:

  • 0 = NONE - The cues for the text track have not been obtained yet
  • 1 = LOADING - The text track is loading, no errors have occurred yet. The parser can still add more cues to the track
  • 2 = Loaded - The text track has been loaded without errors
  • 3 = Error - The text track is enabled, but something fails when the user agent tries to get it. Some or all cues may be lost and cannot be obtained

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 10.0 Not Supported Not Supported Supported