Home Reference Source
import SubtitleTrackController from 'hls.js/src/controller/subtitle-track-controller.ts'
public class | source

SubtitleTrackController

Extends:

src/controller/base-playlist-controller.js~BasePlaylistController → SubtitleTrackController

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

groupId: *

public

media: *

public
public
public
public get
public set
public
public get

get/set index of the selected subtitle track (based on index in subtitle track lists) *

public set
public get

get alternate subtitle tracks list from playlist *

public
public
public

tracks: *

public
public
Private Members
private

Method Summary

Public Methods
public
public
public

loadPlaylist(hlsUrlParameters: HlsUrlParameters)

public

onError(event: undefined, data: ErrorData)

public

onLevelLoading(event: undefined, data: LevelLoadingData)

public

onLevelSwitching(event: undefined, data: LevelSwitchingData)

public
public

onManifestParsed(event: undefined, data: ManifestParsedData)

public

onMediaAttached(event: undefined, data: MediaAttachedData)

public
public

onSubtitleTrackLoaded(event: undefined, data: TrackLoadedData)

public
public
public
public

setSubtitleTrack(newId: number, lastTrack: undefined)

This method is responsible for validating the subtitle index and periodically reloading if live.

public

switchLevel(levelIndex: number)

public

Disables the old subtitleTrack and sets current mode on the next subtitleTrack.

public

Public Constructors

public constructor() source

Public Members

public asyncPollTrackChange: * source

public groupId: * source

public media: * source

public queuedDefaultTrack: number source

public retryCount: number source

public selectDefaultTrack: boolean source

public get subtitleDisplay: boolean source

public set subtitleDisplay: boolean source

public subtitlePollingInterval: number source

public get subtitleTrack: number source

get/set index of the selected subtitle track (based on index in subtitle track lists) *

public set subtitleTrack: number source

public get subtitleTracks: * source

get alternate subtitle tracks list from playlist *

public trackChangeListener: * source

public trackId: number source

public tracks: * source

public tracksInGroup: * source

public useTextTrackPolling: boolean source

Private Members

private _subtitleDisplay: boolean source

Public Methods

public destroy() source

public findTrackId(name: string): number source

Params:

NameTypeAttributeDescription
name string

Return:

number

public loadPlaylist(hlsUrlParameters: HlsUrlParameters) source

Params:

NameTypeAttributeDescription
hlsUrlParameters HlsUrlParameters

public onError(event: undefined, data: ErrorData) source

Params:

NameTypeAttributeDescription
event undefined
data ErrorData

public onLevelLoading(event: undefined, data: LevelLoadingData) source

Params:

NameTypeAttributeDescription
event undefined
data LevelLoadingData

public onLevelSwitching(event: undefined, data: LevelSwitchingData) source

Params:

NameTypeAttributeDescription
event undefined
data LevelSwitchingData

public onManifestLoading() source

public onManifestParsed(event: undefined, data: ManifestParsedData) source

Params:

NameTypeAttributeDescription
event undefined
data ManifestParsedData

public onMediaAttached(event: undefined, data: MediaAttachedData) source

Params:

NameTypeAttributeDescription
event undefined
data MediaAttachedData

public onMediaDetaching() source

public onSubtitleTrackLoaded(event: undefined, data: TrackLoadedData) source

Params:

NameTypeAttributeDescription
event undefined
data TrackLoadedData

public onTextTracksChanged() source

public pollTrackChange(timeout: number) source

Params:

NameTypeAttributeDescription
timeout number

public registerListeners() source

public setSubtitleTrack(newId: number, lastTrack: undefined) 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:

NameTypeAttributeDescription
newId number
lastTrack undefined

public switchLevel(levelIndex: number) source

Params:

NameTypeAttributeDescription
levelIndex number

public toggleTrackModes(newId: number) 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:

NameTypeAttributeDescription
newId number

public unregisterListeners() source