Track readyStateProperty

Track 对象参考手册Track Object

Example

Get the current ready state of the track resource:

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

xThe output value is:

2 // 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 whether the resource is ready to start playing.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer, Opera, and Chrome browsers support the readyState property.

Note:Firefox, Safari, or Internet Explorer 9 and earlier IE versions do not support the readyState property.


Syntax

trackObject.readyState

Technical Details

Return value: A number representing the ready state of the track resource:
  • 0 = NONE - The text track has not been obtained
  • 1 = LOADING - The text track is loading with no errors occurring; next, the parser can add it to the track
  • 2 = LOADED - The text track has finished loading
  • 3 = ERROR - The text track has been enabled, but the user was unable to obtain it; some data has been lost and cannot be correctly obtained.


  • Track 对象参考手册Track Object Other Extensions