import SubtitleTrackController from 'hls.js/src/controller/subtitle-track-controller.js'
SubtitleTrackController
Extends:
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
media: * |
|
public |
Keeps reference to a default track id when media has not been attached yet |
|
public |
|
|
public |
|
|
public |
|
|
public get |
get index of the selected subtitle track (index in subtitle track lists) * |
|
public set |
select a subtitle track, based on its index in subtitle track lists* |
|
public get |
get alternate subtitle tracks list from playlist * |
|
public |
timer: * |
|
public |
|
|
public |
trackId: * |
|
public |
tracks: *[] |
|
public |
|
Method Summary
Public Methods | ||
public |
destroy() |
|
public |
onManifestLoaded(data: *) |
|
public |
onMediaAttached(data: *) |
|
public |
|
|
public |
onSubtitleTrackLoaded(data: *) |
|
public |
|
|
public |
stopLoad() |
Private Methods | ||
private |
|
|
private |
|
|
private |
|
|
private |
_setSubtitleTrackInternal(newId: *) This method is responsible for validating the subtitle index and periodically reloading if live. |
|
private |
_toggleTrackModes(newId: *) Disables the old subtitleTrack and sets current mode on the next subtitleTrack. |
Public Constructors
public constructor() source
Public Members
public media: * source
public queuedDefaultTrack: * source
Keeps reference to a default track id when media has not been attached yet
public subtitlePollingInterval: * source
public get subtitleTrack: * source
get index of the selected subtitle track (index in subtitle track lists) *
public set subtitleTrack source
select a subtitle track, based on its index in subtitle track lists*
public timer: * source
public trackChangeListener: * source
public trackId: * source
public tracks: *[] source
public useTextTrackPolling: * source
Public Methods
public destroy() source
public onManifestLoaded(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |
public onMediaAttached(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |
public onMediaDetaching() source
public onSubtitleTrackLoaded(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |
public startLoad() source
public stopLoad() source
Private Methods
private _clearReloadTimer() source
private _loadCurrentTrack() source
private _onTextTracksChanged() source
private _setSubtitleTrackInternal(newId: *) source
This method is responsible for validating the subtitle index and periodically reloading if live. Dispatches the SUBTITLE_TRACK_SWITCH event, which instructs the subtitle-stream-controller to load the selected track.
Params:
Name | Type | Attribute | Description |
newId | * | The id of the subtitle track to activate. |
private _toggleTrackModes(newId: *) source
Disables the old subtitleTrack and sets current mode on the next subtitleTrack. This operates on the DOM textTracks. A value of -1 will disable all subtitle tracks.
Params:
Name | Type | Attribute | Description |
newId | * | The id of the next track to enable |