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

BaseStreamController

Extends:

src/task-loop.js~TaskLoop → BaseStreamController

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

config: HlsConfig

public
public
public
public
public
public
public

hls: Hls

public
public
public
public

levels: *

public
public

log: *

public
public

media: *

public
public
public
public
public
public
public
public set
public get

state: *

public
public

warn: *

Private Members
private

Method Summary

Public Methods
public

afterBufferFlushed(media: Bufferable, bufferType: SourceBufferName, playlistType: PlaylistLevelType)

public

alignPlaylists(details: LevelDetails, previousDetails: LevelDetails): number

public

bufferFragmentData(data: RemuxedTrack, frag: Fragment, part: undefined, chunkMeta: ChunkMetadata)

public

doFragPartsLoad(frag: Fragment, partList: undefined, partIndex: number, progressCallback: FragmentLoadProgressCallback): Promise

public

doTick()

public
public

flushMainBuffer(startOffset: number, endOffset: number, type: undefined)

public
public
public

getCurrentContext(chunkMeta: ChunkMetadata): {"frag": *, "part": *, "level": *}

public

getFragmentAtPosition(bufferEnd: number, end: number, levelDetails: LevelDetails): *

public

getFwdBufferInfo(bufferable: undefined, type: PlaylistLevelType): *

public

getInitialLiveFragment(levelDetails: LevelDetails, fragments: Array): *

public
public

getMaxBufferLength(levelBitrate: number): number

public

getNextFragment(pos: number, levelDetails: LevelDetails): *

public

getNextPart(partList: undefined, frag: Fragment, targetBufferTime: number): number

public
public
public

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

public

loadKey(frag: Fragment, details: LevelDetails)

public

loadedEndOfParts(partList: undefined, targetBufferTime: number): boolean

public
public

onFragmentOrKeyLoadError(filterType: PlaylistLevelType, data: ErrorData)

public
public
public

onKeyLoaded(event: undefined, data: KeyLoadedData)

public

onLevelSwitching(event: undefined, data: LevelSwitchingData)

public

onMediaAttached(event: undefined, data: MediaAttachingData)

public
public
public
public
public
public
public
public
public
public

setStartPosition(details: LevelDetails, sliding: number)

public

startLoad(startPosition: number)

public
public
public

updateLevelTiming(frag: Fragment, part: undefined, level: Level, partial: boolean)

public
Private Methods
private

_doFragLoad(frag: Fragment, details: LevelDetails, targetBufferTime: undefined, progressCallback: FragmentLoadProgressCallback): Promise

private

_handleFragmentLoadComplete(fragLoadedEndData: PartsLoadedData)

private

_handleFragmentLoadProgress(frag: FragLoadedData)

private
private

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

private
private

_streamEnded(bufferInfo: undefined, levelDetails: LevelDetails): boolean

Public Constructors

public constructor() source

Public Members

public bitrateTest: boolean source

public config: HlsConfig source

public decrypter: Decrypter source

public fragCurrent: * source

public fragLoadError: number source

public fragPrevious: * source

public fragmentLoader: FragmentLoader source

public fragmentTracker: FragmentTracker source

public hls: Hls source

public initPTS: Array source

public lastCurrentTime: number source

public levelLastLoaded: * source

public levels: * source

public loadedmetadata: boolean source

public log: * source

public logPrefix: string source

public media: * source

public mediaBuffer: * source

public nextLoadPosition: number source

public onvended: * source

public onvseeking: * source

public retryDate: number source

public startFragRequested: boolean source

public startPosition: number source

public set state: undefined source

public get state: * source

public transmuxer: * source

public warn: * source

Private Members

private _state: string source

Public Methods

public afterBufferFlushed(media: Bufferable, bufferType: SourceBufferName, playlistType: PlaylistLevelType) source

Params:

NameTypeAttributeDescription
media Bufferable
bufferType SourceBufferName
playlistType PlaylistLevelType

public alignPlaylists(details: LevelDetails, previousDetails: LevelDetails): number source

Params:

NameTypeAttributeDescription
details LevelDetails
previousDetails LevelDetails

Return:

number

public bufferFragmentData(data: RemuxedTrack, frag: Fragment, part: undefined, chunkMeta: ChunkMetadata) source

Params:

NameTypeAttributeDescription
data RemuxedTrack
frag Fragment
part undefined
chunkMeta ChunkMetadata

public doFragPartsLoad(frag: Fragment, partList: undefined, partIndex: number, progressCallback: FragmentLoadProgressCallback): Promise source

Params:

NameTypeAttributeDescription
frag Fragment
partList undefined
partIndex number
progressCallback FragmentLoadProgressCallback

Return:

Promise

public doTick() source

public flushBufferGap(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

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

Params:

NameTypeAttributeDescription
startOffset number
endOffset number
type undefined

public fragBufferedComplete(frag: Fragment, part: undefined) source

Params:

NameTypeAttributeDescription
frag Fragment
part undefined

public fragContextChanged(frag: undefined): * source

Params:

NameTypeAttributeDescription
frag undefined

Return:

*

public getCurrentContext(chunkMeta: ChunkMetadata): {"frag": *, "part": *, "level": *} source

Params:

NameTypeAttributeDescription
chunkMeta ChunkMetadata

Return:

{"frag": *, "part": *, "level": *}

public getFragmentAtPosition(bufferEnd: number, end: number, levelDetails: LevelDetails): * source

Params:

NameTypeAttributeDescription
bufferEnd number
end number
levelDetails LevelDetails

Return:

*

public getFwdBufferInfo(bufferable: undefined, type: PlaylistLevelType): * source

Params:

NameTypeAttributeDescription
bufferable undefined
type PlaylistLevelType

Return:

*

public getInitialLiveFragment(levelDetails: LevelDetails, fragments: Array): * source

Params:

NameTypeAttributeDescription
levelDetails LevelDetails
fragments Array

Return:

*

public getLoadPosition(): number source

Return:

number

public getMaxBufferLength(levelBitrate: number): number source

Params:

NameTypeAttributeDescription
levelBitrate number

Return:

number

public getNextFragment(pos: number, levelDetails: LevelDetails): * source

Params:

NameTypeAttributeDescription
pos number
levelDetails LevelDetails

Return:

*

public getNextPart(partList: undefined, frag: Fragment, targetBufferTime: number): number source

Params:

NameTypeAttributeDescription
partList undefined
frag Fragment
targetBufferTime number

Return:

number

public handleFragLoadAborted(frag: Fragment, part: undefined) source

Params:

NameTypeAttributeDescription
frag Fragment
part undefined

public handleFragLoadError(undefined: LoadError): * source

Params:

NameTypeAttributeDescription
undefined LoadError

Return:

*

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

Params:

NameTypeAttributeDescription
frag Fragment
levelDetails LevelDetails
targetBufferTime number

public loadKey(frag: Fragment, details: LevelDetails) source

Params:

NameTypeAttributeDescription
frag Fragment
details LevelDetails

public loadedEndOfParts(partList: undefined, targetBufferTime: number): boolean source

Params:

NameTypeAttributeDescription
partList undefined
targetBufferTime number

Return:

boolean

public mapToInitFragWhenRequired(frag: undefined): * source

Params:

NameTypeAttributeDescription
frag undefined

Return:

*

public onFragmentOrKeyLoadError(filterType: PlaylistLevelType, data: ErrorData) source

Params:

NameTypeAttributeDescription
filterType PlaylistLevelType
data ErrorData

public onHandlerDestroyed() source

public onHandlerDestroying() source

public onKeyLoaded(event: undefined, data: KeyLoadedData) source

Params:

NameTypeAttributeDescription
event undefined
data KeyLoadedData

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

Params:

NameTypeAttributeDescription
event undefined
data LevelSwitchingData

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

Params:

NameTypeAttributeDescription
event undefined
data MediaAttachingData

public onMediaDetaching() source

public onMediaEnded() source

public onMediaSeeking() source

public onTickEnd() source

public reduceMaxBufferLength(threshold: number): boolean source

Params:

NameTypeAttributeDescription
threshold number

Return:

boolean

public resetFragmentLoading(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

public resetLoadingState() source

public resetStartWhenNotLoaded(level: number) source

Params:

NameTypeAttributeDescription
level number

public resetTransmuxer() source

public setStartPosition(details: LevelDetails, sliding: number) source

Params:

NameTypeAttributeDescription
details LevelDetails
sliding number

public startLoad(startPosition: number) source

Params:

NameTypeAttributeDescription
startPosition number

public stopLoad() source

public synchronizeToLiveEdge(levelDetails: LevelDetails) source

Params:

NameTypeAttributeDescription
levelDetails LevelDetails

public updateLevelTiming(frag: Fragment, part: undefined, level: Level, partial: boolean) source

Params:

NameTypeAttributeDescription
frag Fragment
part undefined
level Level
partial boolean

public waitForCdnTuneIn(details: LevelDetails): * source

Params:

NameTypeAttributeDescription
details LevelDetails

Return:

*

Private Methods

private _doFragLoad(frag: Fragment, details: LevelDetails, targetBufferTime: undefined, progressCallback: FragmentLoadProgressCallback): Promise source

Params:

NameTypeAttributeDescription
frag Fragment
details LevelDetails
targetBufferTime undefined
progressCallback FragmentLoadProgressCallback

Return:

Promise

private _handleFragmentLoadComplete(fragLoadedEndData: PartsLoadedData) source

Params:

NameTypeAttributeDescription
fragLoadedEndData PartsLoadedData

private _handleFragmentLoadProgress(frag: FragLoadedData) source

Params:

NameTypeAttributeDescription
frag FragLoadedData

private _handleTransmuxerFlush(chunkMeta: ChunkMetadata) source

Params:

NameTypeAttributeDescription
chunkMeta ChunkMetadata

private _loadFragForPlayback(frag: Fragment, levelDetails: LevelDetails, targetBufferTime: number) source

Params:

NameTypeAttributeDescription
frag Fragment
levelDetails LevelDetails
targetBufferTime number

private _loadInitSegment(frag: Fragment) source

Params:

NameTypeAttributeDescription
frag Fragment

private _streamEnded(bufferInfo: undefined, levelDetails: LevelDetails): boolean source

Params:

NameTypeAttributeDescription
bufferInfo undefined
levelDetails LevelDetails

Return:

boolean