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

groupId: *

public

media: *

public
public
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
public
public

tracks: *[]

public
public

Method Summary

Public Methods
public
public
public

loadPlaylist(hlsUrlParameters: HlsUrlParameters)

public

onError(event: undefined, data: ErrorData)

public

onLevelLoading(event: undefined, data: LevelLoadingData)

public
public

onManifestParsed(event: undefined, data: ManifestParsedData)

public

onMediaAttached(event: undefined, data: MediaAttachedData)

public
public

onSubtitleTrackLoaded(event: undefined, data: TrackLoadedData)

public
public
public

setSubtitleTrack(newId: number, lastTrack: undefined)

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

public

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

public

Public Constructors

public constructor() source

Public Members

public groupId: * source

public media: * source

public queuedDefaultTrack: number source

public retryCount: number source

public selectDefaultTrack: boolean source

public subtitleDisplay: boolean source

public subtitlePollingInterval: number source

public get subtitleTrack: number source

get index of the selected subtitle track (index in subtitle track lists) *

public set subtitleTrack: number source

select a subtitle track, based on its index in subtitle track lists*

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

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 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 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 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