TextTrack Class
https://html.spec.whatwg.org/multipage/media.html#texttrack
public sealed class TextTrack : EventTarget- Inheritance
EventTargetTextTrack
Properties
| Name | Description |
|---|---|
| ActiveCues | Gets the cues of the track that are active (the current playback position of the media element is in their range), in text track cue order (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-activecues), or null when the track is disabled. The list is live. |
| Cues | Gets the cues of the track, in text track cue order (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-cues), or null when the track is disabled. The list is live. |
| Id | Gets the identifier of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-id): the id attribute of its track element, the identifier of a track of the media resource, or an empty string. |
| InBandMetadataTrackDispatchType | Gets the in-band metadata track dispatch type of a metadata track of the media resource, or an empty string. |
| Kind | Gets the kind of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-kind). |
| Label | Gets the label of the track, or an empty string (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-label). |
| Language | Gets the language of the track (a BCP 47 language tag), or an empty string (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-language). |
| Mode | Gets or sets the mode of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-mode). A track whose mode is not TextTrackMode.Disabled obtains the cues of its track element; a change event is fired at the list of text tracks of the media element when the mode changes. |
| OnCueChange | Gets or sets the event handler of the cuechange event. |
| SourceBuffer | Gets the source buffer that created the track (https://w3c.github.io/media-source/#dom-texttrack-sourcebuffer): always null (the text tracks of the byte streams of the Media Source Extensions are not supported). |
ActiveCues
TextTracks.csGets the cues of the track that are active (the current playback position of the media element is in their range), in text track cue order (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-activecues), or null when the track is disabled. The list is live.
public TextTrackCueList? ActiveCues { get; }Cues
TextTracks.csGets the cues of the track, in text track cue order (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-cues), or null when the track is disabled. The list is live.
public TextTrackCueList? Cues { get; }Property value
See also
Gets the identifier of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-id): the id attribute of its track element, the identifier of a track of the media resource, or an empty string.
public string Id { get; }InBandMetadataTrackDispatchType
TextTracks.csGets the in-band metadata track dispatch type of a metadata track of the media resource, or an empty string.
public string InBandMetadataTrackDispatchType { get; }Kind
TextTracks.csGets the kind of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-kind).
public TextTrackKind Kind { get; }Property value
See also
Label
TextTracks.csGets the label of the track, or an empty string (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-label).
public string Label { get; }Language
TextTracks.csGets the language of the track (a BCP 47 language tag), or an empty string (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-language).
public string Language { get; }Property value
See also
Mode
TextTracks.csGets or sets the mode of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-mode). A track whose mode is not TextTrackMode.Disabled obtains the cues of its track element; a change event is fired at the list of text tracks of the media element when the mode changes.
public TextTrackMode Mode { get; set; }Property value
See also
OnCueChange
TextTracks.csGets or sets the event handler of the cuechange event.
SourceBuffer
TextTracks.csGets the source buffer that created the track (https://w3c.github.io/media-source/#dom-texttrack-sourcebuffer): always null (the text tracks of the byte streams of the Media Source Extensions are not supported).
public SourceBuffer? SourceBuffer { get; }Methods
| Name | Description |
|---|---|
| AddCue(TextTrackCue) | Adds a cue to the list of cues of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-addcue); the cue is first removed from the track it belongs to. |
| RemoveCue(TextTrackCue) | Removes a cue from the list of cues of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-removecue). |
AddCue(TextTrackCue)
TextTracks.csAdds a cue to the list of cues of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-addcue); the cue is first removed from the track it belongs to.
public void AddCue(TextTrackCue cue)RemoveCue(TextTrackCue)
TextTracks.csRemoves a cue from the list of cues of the track (https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-removecue).
public void RemoveCue(TextTrackCue cue)Parameters
cueTextTrackCue
Exceptions
DomException- A
NotFoundErrorwhen the cue is not in the list of cues of the track.