HTML DOM Track readyState Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

Track readyState Property

❮ Track Object

Example

Get the current ready state of the track resource:

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

The result of x could be:

2 // Indicates that the text track has been loaded with no errors


Definition and Usage

The readyState property returns the current ready state of the track resource.

The ready state indicates that the resource is ready to play or not.

Note: This property is read-only.


Browser Support

Property
readyState Yes 10.0 Not supported Not supported Yes

Syntax

trackObject.readyState

Technical Details

Return Value: A Number, representing the ready state of the track resource:
  • 0 = NONE - the text track's cues have not been obtained
  • 1 = LOADING - the text track is loading with no errors yet. Further cues can still be added to the track by the parser
  • 2 = LOADED - the text track has been loaded with no errors
  • 3 = ERROR - the text track was enabled, but when the user agent attempted to obtain it, something failed. Some or all of the cues are likely missing and will not be obtained

❮ Track Object