Home Reference Source
import StreamController from 'hls.js/src/controller/stream-controller.ts'
public class | source

StreamController

Extends:

src/controller/base-stream-controller.js~BaseStreamController → StreamController

Constructor Summary

Public Constructor
public

Member Summary

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

levels: *

public
public
public get
public get
public
public
public
public
public
public
public

state: *

public
public
Private Members
private

Method Summary

Public Methods
public
public
public
public
public

doTick()

public
public

flushMainBuffer(startOffset: number, endOffset: number)

public
public

getAppendedFrag(position: undefined): *

public

getBufferedFrag(position: undefined): *

public
public

loadFragment(frag: Fragment, levelDetails: LevelDetails, targetBufferTime: number)

public

loadKey(frag: Fragment)

public

try to switch ASAP without breaking video playback: in order to ensure smooth but quick level switching, we need to find the next flushable buffer range we should take into account new segment fetch time

public

onAudioTrackSwitched(event: undefined, data: AudioTrackSwitchedData)

public

onAudioTrackSwitching(event: undefined, data: AudioTrackSwitchingData)

public

onBufferCreated(event: undefined, data: BufferCreatedData)

public

onBufferFlushed(event: undefined, undefined: BufferFlushedData)

public

onError(event: undefined, data: ErrorData)

public

onFragBuffered(event: undefined, data: FragBufferedData)

public
public
public

onLevelLoaded(event: undefined, data: LevelLoadedData)

public

onLevelLoading(event: undefined, data: LevelLoadingData)

public

onLevelsUpdated(event: undefined, data: LevelsUpdatedData)

public
public

onManifestParsed(event: undefined, data: ManifestParsedData)

public

onMediaAttached(event: undefined, data: MediaAttachedData)

public
public
public
public
public
public

startLoad(startPosition: number)

public
public
Private Methods
private

_bufferInitSegment(currentLevel: Level, tracks: TrackSet, frag: Fragment, chunkMeta: ChunkMetadata)

private

_getAudioCodec(currentLevel: undefined): *

private

_handleFragmentLoadProgress(data: FragLoadedData)

private

_handleTransmuxComplete(transmuxResult: TransmuxerResult)

private
private
private

Seeks to the set startPosition if not equal to the mediaElement's current time.

private

Public Constructors

public constructor() source

Public Members

public altAudio: boolean source

public audioCodecSwap: boolean source

public audioCodecSwitch: boolean source

public audioOnly: boolean source

public bitrateTest: boolean source

public get currentLevel: * source

public get forceStartLoad: * source

public fragCurrent: * source

public fragLastKbps: number source

public fragLoadError: number source

public fragPlaying: * source

public fragPrevious: * source

public gapController: * source

public lastCurrentTime: * source

public level: number source

public levelLastLoaded: * source

public levels: * source

public loadedmetadata: boolean source

public mediaBuffer: * source

public get nextBufferedFrag: * source

public get nextLevel: * source

public nextLoadPosition: * source

public onvplaying: * source

public onvseeked: * source

public stalled: boolean source

public startFragRequested: boolean source

public startPosition: * source

public state: * source

public transmuxer: * source

public videoBuffer: * source

Private Members

private _forceStartLoad: boolean source

Public Methods

public abortCurrentFrag() source

public backtrack(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

public checkBuffer() source

public checkFragmentChanged() source

public doTick() source

public doTickIdle() source

public flushMainBuffer(startOffset: number, endOffset: number) source

Params:

NameTypeAttributeDescription
startOffset number
endOffset number

public followingBufferedFrag(frag: undefined): * source

Params:

NameTypeAttributeDescription
frag undefined

Return:

*

public getAppendedFrag(position: undefined): * source

Params:

NameTypeAttributeDescription
position undefined

Return:

*

public getBufferedFrag(position: undefined): * source

Params:

NameTypeAttributeDescription
position undefined

Return:

*

public immediateLevelSwitch() source

public loadFragment(frag: Fragment, levelDetails: LevelDetails, targetBufferTime: number) source

Params:

NameTypeAttributeDescription
frag Fragment
levelDetails LevelDetails
targetBufferTime number

public loadKey(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

public nextLevelSwitch() source

try to switch ASAP without breaking video playback: in order to ensure smooth but quick level switching, we need to find the next flushable buffer range we should take into account new segment fetch time

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

Params:

NameTypeAttributeDescription
event undefined
data AudioTrackSwitchedData

public onAudioTrackSwitching(event: undefined, data: AudioTrackSwitchingData) source

Params:

NameTypeAttributeDescription
event undefined
data AudioTrackSwitchingData

public onBufferCreated(event: undefined, data: BufferCreatedData) source

Params:

NameTypeAttributeDescription
event undefined
data BufferCreatedData

public onBufferFlushed(event: undefined, undefined: BufferFlushedData) source

Params:

NameTypeAttributeDescription
event undefined
undefined BufferFlushedData

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

Params:

NameTypeAttributeDescription
event undefined
data ErrorData

public onFragBuffered(event: undefined, data: FragBufferedData) source

Params:

NameTypeAttributeDescription
event undefined
data FragBufferedData

public onFragLoadEmergencyAborted() source

public onHandlerDestroying() source

public onLevelLoaded(event: undefined, data: LevelLoadedData) source

Params:

NameTypeAttributeDescription
event undefined
data LevelLoadedData

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

Params:

NameTypeAttributeDescription
event undefined
data LevelLoadingData

public onLevelsUpdated(event: undefined, data: LevelsUpdatedData) source

Params:

NameTypeAttributeDescription
event undefined
data LevelsUpdatedData

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 onMediaPlaying() source

public onMediaSeeked() source

public onTickEnd() source

public resetTransmuxer() source

public startLoad(startPosition: number) source

Params:

NameTypeAttributeDescription
startPosition number

public stopLoad() source

public swapAudioCodec() source

Private Methods

private _bufferInitSegment(currentLevel: Level, tracks: TrackSet, frag: Fragment, chunkMeta: ChunkMetadata) source

Params:

NameTypeAttributeDescription
currentLevel Level
tracks TrackSet
frag Fragment
chunkMeta ChunkMetadata

private _getAudioCodec(currentLevel: undefined): * source

Params:

NameTypeAttributeDescription
currentLevel undefined

Return:

*

private _handleFragmentLoadProgress(data: FragLoadedData) source

Params:

NameTypeAttributeDescription
data FragLoadedData

private _handleTransmuxComplete(transmuxResult: TransmuxerResult) source

Params:

NameTypeAttributeDescription
transmuxResult TransmuxerResult

private _loadBitrateTestFrag(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

private _registerListeners() source

private _seekToStartPos() source

Seeks to the set startPosition if not equal to the mediaElement's current time.

private _unregisterListeners() source