Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Track readyState Property

Track readyState Property

Track Object Reference The Track object

Example

Get the current readiness state of the track resource:

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

x Output value:

2 // The text track has been loaded with no error


Definition and Usage

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

The readiness 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 versions do not support the readyState property.


Syntax

trackObject

.readyState

Technical Details

Return Value: A number representing the readiness state of the track resource:
  • 0 = NONE - No text track has been obtained
  • 1 = LOADING - The text track is loading and no error has occurred; the parser can then add it to the track
  • 2 = LOADED - The text track has finished loading
  • 3 = ERROR - The text track is enabled but the user cannot retrieve it; some data has been lost and cannot be correctly obtained.

  • Track Object Reference The Track object