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

AudioTrackController

Extends:

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

Implements:

  • EventHandler

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public get
public set
public get
public
public
public
public

tracks: *[]

Private Members
private

Method Summary

Public Methods
public
public

loadPlaylist(hlsUrlParameters: HlsUrlParameters)

public

onAudioTrackLoaded(event: undefined, data: AudioTrackLoadedData)

Store track details of loaded track in our data-model.

public

onAudioTrackSwitched(event: undefined, data: TrackSwitchedData)

Update the internal group ID to any audio-track we may have set manually or because of a failure-handling fallback.

public

onError(event: undefined, data: ErrorData)

public

onLevelLoading(event: undefined, data: LevelLoadingData)

When a level is loading, if it has redundant audioGroupIds (in the same ordinality as it's redundant URLs) we are setting our audio-group ID internally to the one set, if it is different from the group ID currently set.

If group-ID got update, we re-select the appropriate audio-track with this group-ID matching the currently selected one (based on NAME property).

public

Reset audio tracks on new manifest loading.

public

onManifestParsed(event: undefined, data: ManifestParsedData)

Store tracks data from manifest parsed data.

public

recoverTrack(errorEvent: ErrorData, trackId: number)

Private Methods
private
private
private
private
private

Public Constructors

public constructor() source

Public Members

public audioGroupId: * source

public get audioTrack: number source

public set audioTrack: number source

public get audioTracks: * source

public restrictedTracks: * source

public retryCount: number source

public trackId: number source

public tracks: *[] source

Private Members

private selectDefaultTrack: boolean source

Public Methods

public destroy() source

public loadPlaylist(hlsUrlParameters: HlsUrlParameters) source

Params:

NameTypeAttributeDescription
hlsUrlParameters HlsUrlParameters

public onAudioTrackLoaded(event: undefined, data: AudioTrackLoadedData) source

Store track details of loaded track in our data-model.

Set-up metadata update interval task for live-mode streams.

Params:

NameTypeAttributeDescription
event undefined
data AudioTrackLoadedData

public onAudioTrackSwitched(event: undefined, data: TrackSwitchedData) source

Update the internal group ID to any audio-track we may have set manually or because of a failure-handling fallback.

Quality-levels should update to that group ID in this case.

Params:

NameTypeAttributeDescription
event undefined
data TrackSwitchedData

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

Params:

NameTypeAttributeDescription
event undefined
data ErrorData

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

When a level is loading, if it has redundant audioGroupIds (in the same ordinality as it's redundant URLs) we are setting our audio-group ID internally to the one set, if it is different from the group ID currently set.

If group-ID got update, we re-select the appropriate audio-track with this group-ID matching the currently selected one (based on NAME property).

Params:

NameTypeAttributeDescription
event undefined
data LevelLoadingData

public onManifestLoading() source

Reset audio tracks on new manifest loading.

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

Store tracks data from manifest parsed data.

Trigger AUDIO_TRACKS_UPDATED event.

Params:

NameTypeAttributeDescription
event undefined
data ManifestParsedData

public recoverTrack(errorEvent: ErrorData, trackId: number) source

Params:

NameTypeAttributeDescription
errorEvent ErrorData
trackId number

Private Methods

private _registerListeners() source

private _selectAudioGroup(levelId: number) source

Params:

NameTypeAttributeDescription
levelId number

private _selectInitialAudioTrack() source

private _setAudioTrack(newId: number) source

Params:

NameTypeAttributeDescription
newId number

private _unregisterListeners() source