Home Reference Source

Function

Static Public Summary
public
public

addCueToTrack(track: TextTrack, cue: VTTCue)

public

addGroupId(level: Level, type: string, id: string)

public

addSliding(details: LevelDetails, start: number)

public

adjustSliding(oldDetails: LevelDetails, newDetails: LevelDetails)

public

adjustSlidingStart(sliding: number, details: LevelDetails)

public
public

Ensures appropriate time-alignment between renditions based on PDT.

public

alignPDT(details: LevelDetails, lastDetails: LevelDetails)

Computes the PTS of a new level's fragments using the difference in Program Date Time from the last level.

public

alignStream(lastFrag: undefined, lastLevel: undefined, details: LevelDetails)

Using the parameters of the last level, this function computes PTS' of the new fragments so that they form a contiguous stream with the last fragments. The PTS of a fragment lets Hls.js know where it fits into a stream - by knowing every PTS, we know which fragment to download at any given time. PTS is normally computed when the fragment is demuxed, so taking this step saves us time and an extra download.

public

appendFrame(track: DemuxedAudioTrack, data: Uint8Array, offset: number, pts: number, frameIndex: number): AudioFrame

public

appendFrame(track: DemuxedAudioTrack, data: Uint8Array, offset: number, pts: number, frameIndex: number): {"sample": *, "length": *, "missing": *}

public
public
public
public
public

canParse(data: Uint8Array, offset: number): boolean

public

canParse(data: *, offset: *): *

public

canParse(data: Uint8Array, offset: number): boolean

public
public

clearCurrentCues(track: TextTrack)

public
public

computeReloadInterval(newDetails: LevelDetails, distanceToLiveEdgeMs: number): number

public

decodeFrame(frame: *): *

public

remove Emulation Prevention bytes from a RBSP

public

dummyTrack(type: undefined, inputTimeScale: undefined): DemuxedTrack

public

enableLogs(debugConfig: undefined)

public
public
public

findBox(data: Uint8Array, path: undefined): *

public
public

findFirstFragWithCC(fragments: undefined, cc: number): *

public

findFragWithCC(fragments: undefined, cc: number): *

public

findFragmentByPDT(fragments: Array, PDTValue: undefined, maxFragLookUpTolerance: number): *

Returns first fragment whose endPdt value exceeds the given PDT.

public

findFragmentByPTS(fragPrevious: undefined, fragments: Array, bufferEnd: number, maxFragLookUpTolerance: number): *

Finds a fragment based on the SN of the previous fragment; or based on the needs of the current buffer.

public
public

flushTextTrackMetadataCueSamples(track: DemuxedMetadataTrack, timeOffset: number, initPTS: number, initDTS: number): {"samples": *}

public

flushTextTrackUserdataCueSamples(track: DemuxedUserdataTrack, timeOffset: number, initPTS: number): {"samples": *}

public

fragmentWithinToleranceTest(bufferEnd: undefined, maxFragLookUpTolerance: undefined, candidate: Fragment): number

The test function used by the findFragmentBySn's BinarySearch to look for the best match to the current buffer conditions.

public

generateCueId(startTime: number, endTime: number, text: string): *

public

getAudioConfig(observer: undefined, data: Uint8Array, offset: number, audioCodec: string): {"config": *, "samplerate": *, "channelCount": *, "codec": *, "manifestCodec": *}

public

getCuesInRange(cues: undefined, start: number, end: number): *

public

getDuration(data: Uint8Array, initData: InitData): *

public

getFragmentWithSN(level: Level, sn: number, fragCurrent: undefined): *

public
public
public
public

getID3Data(data: Uint8Array, offset: number): Uint8Array | undefined

Returns any adjacent ID3 tags found in data starting at offset, as one block of data

public

getID3Frames(id3Data: Uint8Array): ID3.Frame[]

Returns an array of ID3 frames found in all the ID3 tags in the id3Data

public

MediaSource helper

public

getPartWith(level: Level, sn: number, partIndex: number): *

public

getSkipValue(details: LevelDetails, msn: number): HlsSkip

public

getStartDTS(initData: InitData, fmp4: Uint8Array): number

Determine the base media decode start time, in seconds, for an MP4 fragment.

public

getTimeStamp(data: Uint8Array): number | undefined

Searches for the Elementary Stream timestamp found in the ID3 data chunk

public

initPTSFn(timestamp: *, timeOffset: *, initPTS: *): *

Initialize PTS

use timestamp unless it is undefined, NaN or Infinity

public

initTrackConfig(track: DemuxedAudioTrack, observer: HlsEventEmitter, data: Uint8Array, offset: number, audioCodec: string)

public

isCodecSupportedInMp4(codec: string, type: CodecType): boolean

public

isCodecType(codec: string, type: CodecType): boolean

public

isFooter(data: Uint8Array, offset: number): boolean

Returns true if an ID3 footer can be found at offset in data

public

isHeader(data: Uint8Array, offset: number): boolean

public

isHeader(data: Uint8Array, offset: number): boolean

Returns true if an ID3 header can be found at offset in data

public

isHeader(data: Uint8Array, offset: number): boolean

public
public
public
public
public

isTimeStampFrame(frame: ID3 frame): *

Returns true if the ID3 frame is an Elementary Stream timestamp frame

public

mapFragmentIntersection(oldDetails: LevelDetails, newDetails: LevelDetails, intersectionFn: FragmentIntersection)

public

mapPartIntersection(oldParts: undefined, newParts: undefined, intersectionFn: PartIntersection)

public

mergeConfig(defaultConfig: HlsConfig, userConfig: Partial): HlsConfig

public

mergeDetails(oldDetails: LevelDetails, newDetails: LevelDetails)

public

normalizePts(value: number, reference: undefined): number

public

offsetStartDTS(initData: InitData, fmp4: Uint8Array, timeOffset: number)

public

parseEmsg(data: Uint8Array): IEmsgParsingData

public

parseFrameHeader(data: Uint8Array, offset: number): {"headerLength": *, "frameLength": *}

public

parseHeader(data: Uint8Array, offset: number): {"sampleRate": *, "channelCount": *, "frameLength": *, "samplesPerFrame": *}

public

parseIMSC1(payload: ArrayBuffer, initPTS: number, timescale: number, callBack: undefined, errorCallBack: undefined)

public

parseInitSegment(initSegment: Uint8Array): InitData

public

parseSEIMessageFromNALu(unescapedData: Uint8Array, headerSize: number, pts: number, samples: undefined)

public

parseSamples(timeOffset: number, track: PassthroughTrack): *

public

parseSegmentIndex(sidx: Uint8Array): {"earliestPresentationTime": *, "timescale": *, "version": *, "referencesCount": *, "references": *}

public

parseTimeStamp(input: string): *

public

parseWebVTT(vttByteArray: ArrayBuffer, initPTS: number, timescale: number, vttCCs: VTTCCs, cc: number, timeOffset: number, callBack: undefined, errorCallBack: undefined)

public

pdtWithinToleranceTest(pdtBufferEnd: number, maxFragLookUpTolerance: number, candidate: Fragment): boolean

The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions. This function tests the candidate's program date time values, as represented in Unix time

public

probe(data: Uint8Array, offset: number): boolean

public

probe(data: Uint8Array, offset: number): boolean

public

readSint32(buffer: Uint8Array, offset: number): number

public

readUint16(buffer: Uint8Array, offset: number): number

public

readUint32(buffer: Uint8Array, offset: number): number

public

removeCuesInRange(track: TextTrack, start: number, end: number, predicate: undefined)

public
public

segmentValidRange(data: Uint8Array): SegmentedRange

public

sendAddTrackEvent(track: TextTrack, videoEl: HTMLMediaElement)

public
public

sliceUint8(array: Uint8Array, start: number, end: number): Uint8Array

public
public
public

toTimescaleFromBase(value: undefined, destScale: number, srcBase: number, round: boolean): number

public

toTimescaleFromScale(value: undefined, destScale: number, srcScale: number, round: boolean): number

public

updateFragPTSDTS(details: undefined, frag: Fragment, startPTS: number, endPTS: number, startDTS: number, endDTS: number): number

public

updatePTS(fragments: undefined, fromIdx: number, toIdx: number)

public

utf8ArrayToStr(array: *, exitOnNull: boolean): *

public

writeUint32(buffer: Uint8Array, offset: number, value: number)

Static Public

public TransmuxerWorker(self: undefined) source

import TransmuxerWorker from 'hls.js/src/demux/transmuxer-worker.ts'

Params:

NameTypeAttributeDescription
self undefined

public addCueToTrack(track: TextTrack, cue: VTTCue) source

import {addCueToTrack} from 'hls.js/src/utils/texttrack-utils.ts'

Params:

NameTypeAttributeDescription
track TextTrack
cue VTTCue

public addGroupId(level: Level, type: string, id: string) source

import {addGroupId} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
level Level
type string
id string

public addSliding(details: LevelDetails, start: number) source

import {addSliding} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
details LevelDetails
start number

public adjustSliding(oldDetails: LevelDetails, newDetails: LevelDetails) source

import {adjustSliding} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
oldDetails LevelDetails
newDetails LevelDetails

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

import {adjustSlidingStart} from 'hls.js/src/utils/discontinuities.ts'

Params:

NameTypeAttributeDescription
sliding number
details LevelDetails

public alignFragmentByPDTDelta(frag: Fragment, delta: number) source

import {alignFragmentByPDTDelta} from 'hls.js/src/utils/discontinuities.ts'

Params:

NameTypeAttributeDescription
frag Fragment
delta number

public alignMediaPlaylistByPDT(details: LevelDetails, refDetails: LevelDetails) source

import {alignMediaPlaylistByPDT} from 'hls.js/src/utils/discontinuities.ts'

Ensures appropriate time-alignment between renditions based on PDT. Unlike alignPDT, which adjusts the timeline based on the delta between PDTs of the 0th fragment of two playlists/LevelDetails, this function assumes the timelines represented in refDetails are accurate, including the PDTs, and uses the "wallclock"/PDT timeline as a cross-reference to details, adjusting the presentation times/timelines of details accordingly. Given the asynchronous nature of fetches and initial loads of live main and audio/subtitle tracks, the primary purpose of this function is to ensure the "local timelines" of audio/subtitle tracks are aligned to the main/video timeline, using PDT as the cross-reference/"anchor" that should be consistent across playlists, per the HLS spec.

Params:

NameTypeAttributeDescription
details LevelDetails
refDetails LevelDetails

public alignPDT(details: LevelDetails, lastDetails: LevelDetails) source

import {alignPDT} from 'hls.js/src/utils/discontinuities.ts'

Computes the PTS of a new level's fragments using the difference in Program Date Time from the last level.

Params:

NameTypeAttributeDescription
details LevelDetails
lastDetails LevelDetails

public alignStream(lastFrag: undefined, lastLevel: undefined, details: LevelDetails) source

import {alignStream} from 'hls.js/src/utils/discontinuities.ts'

Using the parameters of the last level, this function computes PTS' of the new fragments so that they form a contiguous stream with the last fragments. The PTS of a fragment lets Hls.js know where it fits into a stream - by knowing every PTS, we know which fragment to download at any given time. PTS is normally computed when the fragment is demuxed, so taking this step saves us time and an extra download.

Params:

NameTypeAttributeDescription
lastFrag undefined
lastLevel undefined
details LevelDetails

public appendFrame(track: DemuxedAudioTrack, data: Uint8Array, offset: number, pts: number, frameIndex: number): AudioFrame source

import {appendFrame} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
track DemuxedAudioTrack
data Uint8Array
offset number
pts number
frameIndex number

Return:

AudioFrame

public appendFrame(track: DemuxedAudioTrack, data: Uint8Array, offset: number, pts: number, frameIndex: number): {"sample": *, "length": *, "missing": *} source

import {appendFrame} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
track DemuxedAudioTrack
data Uint8Array
offset number
pts number
frameIndex number

Return:

{"sample": *, "length": *, "missing": *}

public appendUint8Array(data1: Uint8Array, data2: Uint8Array): Uint8Array source

import {appendUint8Array} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data1 Uint8Array
data2 Uint8Array

Return:

Uint8Array

public assignTrackIdsByGroup(tracks: undefined) source

import {assignTrackIdsByGroup} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
tracks undefined

public bin2str(data: Uint8Array): string source

import {bin2str} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

string

public canGetFrameLength(data: Uint8Array, offset: number): boolean source

import {canGetFrameLength} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public canParse(data: Uint8Array, offset: number): boolean source

import {canParse} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public canParse(data: *, offset: *): * source

import {canParse} from 'hls.js/src/demux/id3.ts'

Params:

NameTypeAttributeDescription
data *
offset *

Return:

*

public canParse(data: Uint8Array, offset: number): boolean source

import {canParse} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public changeTypeSupported(): boolean source

import {changeTypeSupported} from 'hls.js/src/is-supported.ts'

Return:

boolean

public clearCurrentCues(track: TextTrack) source

import {clearCurrentCues} from 'hls.js/src/utils/texttrack-utils.ts'

Params:

NameTypeAttributeDescription
track TextTrack

public computeRawDurationFromSamples(trun: undefined): number source

import {computeRawDurationFromSamples} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
trun undefined

Return:

number

public computeReloadInterval(newDetails: LevelDetails, distanceToLiveEdgeMs: number): number source

import {computeReloadInterval} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
newDetails LevelDetails
distanceToLiveEdgeMs number

Return:

number

public decodeFrame(frame: *): * source

import {decodeFrame} from 'hls.js/src/demux/id3.ts'

Params:

NameTypeAttributeDescription
frame *

Return:

*

public discardEPB(data: Uint8Array): Uint8Array source

import {discardEPB} from 'hls.js/src/utils/mp4-tools.ts'

remove Emulation Prevention bytes from a RBSP

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

Uint8Array

public dummyTrack(type: undefined, inputTimeScale: undefined): DemuxedTrack source

import {dummyTrack} from 'hls.js/src/demux/dummy-demuxed-track.ts'

Params:

NameTypeAttributeDescription
type undefined
inputTimeScale undefined

Return:

DemuxedTrack

public enableLogs(debugConfig: undefined) source

import {enableLogs} from 'hls.js/src/utils/logger.ts'

Params:

NameTypeAttributeDescription
debugConfig undefined

public enableStreamingMode(config: undefined) source

import {enableStreamingMode} from 'hls.js/src/config.ts'

Params:

NameTypeAttributeDescription
config undefined

public fetchSupported(): boolean source

import {fetchSupported} from 'hls.js/src/utils/fetch-loader.ts'

Return:

boolean

public findBox(data: Uint8Array, path: undefined): * source

import {findBox} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
path undefined

Return:

*

public findDiscontinuousReferenceFrag(prevDetails: LevelDetails, curDetails: LevelDetails): * source

import {findDiscontinuousReferenceFrag} from 'hls.js/src/utils/discontinuities.ts'

Params:

NameTypeAttributeDescription
prevDetails LevelDetails
curDetails LevelDetails

Return:

*

public findFirstFragWithCC(fragments: undefined, cc: number): * source

import {findFirstFragWithCC} from 'hls.js/src/utils/discontinuities.ts'

Params:

NameTypeAttributeDescription
fragments undefined
cc number

Return:

*

public findFragWithCC(fragments: undefined, cc: number): * source

import {findFragWithCC} from 'hls.js/src/controller/fragment-finders.ts'

Params:

NameTypeAttributeDescription
fragments undefined
cc number

Return:

*

public findFragmentByPDT(fragments: Array, PDTValue: undefined, maxFragLookUpTolerance: number): * source

import {findFragmentByPDT} from 'hls.js/src/controller/fragment-finders.ts'

Returns first fragment whose endPdt value exceeds the given PDT.

Params:

NameTypeAttributeDescription
fragments Array
PDTValue undefined
maxFragLookUpTolerance number

Return:

*

public findFragmentByPTS(fragPrevious: undefined, fragments: Array, bufferEnd: number, maxFragLookUpTolerance: number): * source

import {findFragmentByPTS} from 'hls.js/src/controller/fragment-finders.ts'

Finds a fragment based on the SN of the previous fragment; or based on the needs of the current buffer. This method compensates for small buffer gaps by applying a tolerance to the start of any candidate fragment, thus breaking any traps which would cause the same fragment to be continuously selected within a small range.

Params:

NameTypeAttributeDescription
fragPrevious undefined
fragments Array
bufferEnd number
maxFragLookUpTolerance number

Return:

*

public fixLineBreaks(input: string): string source

import {fixLineBreaks} from 'hls.js/src/utils/vttparser.ts'

Params:

NameTypeAttributeDescription
input string

Return:

string

public flushTextTrackMetadataCueSamples(track: DemuxedMetadataTrack, timeOffset: number, initPTS: number, initDTS: number): {"samples": *} source

import {flushTextTrackMetadataCueSamples} from 'hls.js/src/remux/mp4-remuxer.ts'

Params:

NameTypeAttributeDescription
track DemuxedMetadataTrack
timeOffset number
initPTS number
initDTS number

Return:

{"samples": *}

public flushTextTrackUserdataCueSamples(track: DemuxedUserdataTrack, timeOffset: number, initPTS: number): {"samples": *} source

import {flushTextTrackUserdataCueSamples} from 'hls.js/src/remux/mp4-remuxer.ts'

Params:

NameTypeAttributeDescription
track DemuxedUserdataTrack
timeOffset number
initPTS number

Return:

{"samples": *}

public fragmentWithinToleranceTest(bufferEnd: undefined, maxFragLookUpTolerance: undefined, candidate: Fragment): number source

import {fragmentWithinToleranceTest} from 'hls.js/src/controller/fragment-finders.ts'

The test function used by the findFragmentBySn's BinarySearch to look for the best match to the current buffer conditions.

Params:

NameTypeAttributeDescription
bufferEnd undefined
maxFragLookUpTolerance undefined
candidate Fragment

Return:

number

public generateCueId(startTime: number, endTime: number, text: string): * source

import {generateCueId} from 'hls.js/src/utils/webvtt-parser.ts'

Params:

NameTypeAttributeDescription
startTime number
endTime number
text string

Return:

*

public getAudioConfig(observer: undefined, data: Uint8Array, offset: number, audioCodec: string): {"config": *, "samplerate": *, "channelCount": *, "codec": *, "manifestCodec": *} source

import {getAudioConfig} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
observer undefined
data Uint8Array
offset number
audioCodec string

Return:

{"config": *, "samplerate": *, "channelCount": *, "codec": *, "manifestCodec": *}

public getCuesInRange(cues: undefined, start: number, end: number): * source

import {getCuesInRange} from 'hls.js/src/utils/texttrack-utils.ts'

Params:

NameTypeAttributeDescription
cues undefined
start number
end number

Return:

*

public getDuration(data: Uint8Array, initData: InitData): * source

import {getDuration} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
initData InitData

Return:

*

public getFragmentWithSN(level: Level, sn: number, fragCurrent: undefined): * source

import {getFragmentWithSN} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
level Level
sn number
fragCurrent undefined

Return:

*

public getFrameDuration(samplerate: number): number source

import {getFrameDuration} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
samplerate number

Return:

number

public getFullFrameLength(data: Uint8Array, offset: number): number source

import {getFullFrameLength} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

number

public getHeaderLength(data: Uint8Array, offset: number): number source

import {getHeaderLength} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

number

public getID3Data(data: Uint8Array, offset: number): Uint8Array | undefined source

import {getID3Data} from 'hls.js/src/demux/id3.ts'

Returns any adjacent ID3 tags found in data starting at offset, as one block of data

Params:

NameTypeAttributeDescription
data Uint8Array

The data to search in

offset number

The offset at which to start searching

Return:

Uint8Array | undefined

The block of data containing any ID3 tags found or undefined if no header is found at the starting offset

public getID3Frames(id3Data: Uint8Array): ID3.Frame[] source

import {getID3Frames} from 'hls.js/src/demux/id3.ts'

Returns an array of ID3 frames found in all the ID3 tags in the id3Data

Params:

NameTypeAttributeDescription
id3Data Uint8Array

The ID3 data containing one or more ID3 tags

Return:

ID3.Frame[]

Array of ID3 frame objects

public getMediaSource(): * source

import {getMediaSource} from 'hls.js/src/utils/mediasource-helper.ts'

MediaSource helper

Return:

*

public getPartWith(level: Level, sn: number, partIndex: number): * source

import {getPartWith} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
level Level
sn number
partIndex number

Return:

*

public getSkipValue(details: LevelDetails, msn: number): HlsSkip source

import {getSkipValue} from 'hls.js/src/types/level.ts'

Params:

NameTypeAttributeDescription
details LevelDetails
msn number

Return:

HlsSkip

public getStartDTS(initData: InitData, fmp4: Uint8Array): number source

import {getStartDTS} from 'hls.js/src/utils/mp4-tools.ts'

Determine the base media decode start time, in seconds, for an MP4 fragment. If multiple fragments are specified, the earliest time is returned.

The base media decode time can be parsed from track fragment metadata:

moof > traf > tfdt.baseMediaDecodeTime

It requires the timescale value from the mdhd to interpret.

Params:

NameTypeAttributeDescription
initData InitData
fmp4 Uint8Array

Return:

number

public getTimeStamp(data: Uint8Array): number | undefined source

import {getTimeStamp} from 'hls.js/src/demux/id3.ts'

Searches for the Elementary Stream timestamp found in the ID3 data chunk

Params:

NameTypeAttributeDescription
data Uint8Array

Block of data containing one or more ID3 tags

Return:

number | undefined

The timestamp

public initPTSFn(timestamp: *, timeOffset: *, initPTS: *): * source

import {initPTSFn} from 'hls.js/src/demux/base-audio-demuxer.ts'

Initialize PTS

use timestamp unless it is undefined, NaN or Infinity

Params:

NameTypeAttributeDescription
timestamp *
timeOffset *
initPTS *

Return:

*

public initTrackConfig(track: DemuxedAudioTrack, observer: HlsEventEmitter, data: Uint8Array, offset: number, audioCodec: string) source

import {initTrackConfig} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
track DemuxedAudioTrack
observer HlsEventEmitter
data Uint8Array
offset number
audioCodec string

public isCodecSupportedInMp4(codec: string, type: CodecType): boolean source

import {isCodecSupportedInMp4} from 'hls.js/src/utils/codecs.ts'

Params:

NameTypeAttributeDescription
codec string
type CodecType

Return:

boolean

public isCodecType(codec: string, type: CodecType): boolean source

import {isCodecType} from 'hls.js/src/utils/codecs.ts'

Params:

NameTypeAttributeDescription
codec string
type CodecType

Return:

boolean

public isFooter(data: Uint8Array, offset: number): boolean source

import {isFooter} from 'hls.js/src/demux/id3.ts'

Returns true if an ID3 footer can be found at offset in data

Params:

NameTypeAttributeDescription
data Uint8Array

The data to search in

offset number

The offset at which to start searching

Return:

boolean

True if an ID3 footer is found

public isHeader(data: Uint8Array, offset: number): boolean source

import {isHeader} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public isHeader(data: Uint8Array, offset: number): boolean source

import {isHeader} from 'hls.js/src/demux/id3.ts'

Returns true if an ID3 header can be found at offset in data

Params:

NameTypeAttributeDescription
data Uint8Array

The data to search in

offset number

The offset at which to start searching

Return:

boolean

True if an ID3 header is found

public isHeader(data: Uint8Array, offset: number): boolean source

import {isHeader} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public isHeaderPattern(data: Uint8Array, offset: number): boolean source

import {isHeaderPattern} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public isHeaderPattern(data: Uint8Array, offset: number): boolean source

import {isHeaderPattern} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public isPromise(p: undefined): * source

import {isPromise} from 'hls.js/src/demux/transmuxer.ts'

Params:

NameTypeAttributeDescription
p undefined

Return:

*

public isSupported(): boolean source

import {isSupported} from 'hls.js/src/is-supported.ts'

Return:

boolean

public isTimeStampFrame(frame: ID3 frame): * source

import {isTimeStampFrame} from 'hls.js/src/demux/id3.ts'

Returns true if the ID3 frame is an Elementary Stream timestamp frame

Params:

NameTypeAttributeDescription
frame ID3 frame

Return:

*

public mapFragmentIntersection(oldDetails: LevelDetails, newDetails: LevelDetails, intersectionFn: FragmentIntersection) source

import {mapFragmentIntersection} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
oldDetails LevelDetails
newDetails LevelDetails
intersectionFn FragmentIntersection

public mapPartIntersection(oldParts: undefined, newParts: undefined, intersectionFn: PartIntersection) source

import {mapPartIntersection} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
oldParts undefined
newParts undefined
intersectionFn PartIntersection

public mergeConfig(defaultConfig: HlsConfig, userConfig: Partial): HlsConfig source

import {mergeConfig} from 'hls.js/src/config.ts'

Params:

NameTypeAttributeDescription
defaultConfig HlsConfig
userConfig Partial

Return:

HlsConfig

public mergeDetails(oldDetails: LevelDetails, newDetails: LevelDetails) source

import {mergeDetails} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
oldDetails LevelDetails
newDetails LevelDetails

public normalizePts(value: number, reference: undefined): number source

import {normalizePts} from 'hls.js/src/remux/mp4-remuxer.ts'

Params:

NameTypeAttributeDescription
value number
reference undefined

Return:

number

public offsetStartDTS(initData: InitData, fmp4: Uint8Array, timeOffset: number) source

import {offsetStartDTS} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
initData InitData
fmp4 Uint8Array
timeOffset number

public parseEmsg(data: Uint8Array): IEmsgParsingData source

import {parseEmsg} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

IEmsgParsingData

public parseFrameHeader(data: Uint8Array, offset: number): {"headerLength": *, "frameLength": *} source

import {parseFrameHeader} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

{"headerLength": *, "frameLength": *}

public parseHeader(data: Uint8Array, offset: number): {"sampleRate": *, "channelCount": *, "frameLength": *, "samplesPerFrame": *} source

import {parseHeader} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

{"sampleRate": *, "channelCount": *, "frameLength": *, "samplesPerFrame": *}

public parseIMSC1(payload: ArrayBuffer, initPTS: number, timescale: number, callBack: undefined, errorCallBack: undefined) source

import {parseIMSC1} from 'hls.js/src/utils/imsc1-ttml-parser.ts'

Params:

NameTypeAttributeDescription
payload ArrayBuffer
initPTS number
timescale number
callBack undefined
errorCallBack undefined

public parseInitSegment(initSegment: Uint8Array): InitData source

import {parseInitSegment} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
initSegment Uint8Array

Return:

InitData

public parseSEIMessageFromNALu(unescapedData: Uint8Array, headerSize: number, pts: number, samples: undefined) source

import {parseSEIMessageFromNALu} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
unescapedData Uint8Array
headerSize number
pts number
samples undefined

public parseSamples(timeOffset: number, track: PassthroughTrack): * source

import {parseSamples} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
timeOffset number
track PassthroughTrack

Return:

*

public parseSegmentIndex(sidx: Uint8Array): {"earliestPresentationTime": *, "timescale": *, "version": *, "referencesCount": *, "references": *} source

import {parseSegmentIndex} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
sidx Uint8Array

Return:

{"earliestPresentationTime": *, "timescale": *, "version": *, "referencesCount": *, "references": *}

public parseTimeStamp(input: string): * source

import {parseTimeStamp} from 'hls.js/src/utils/vttparser.ts'

Params:

NameTypeAttributeDescription
input string

Return:

*

public parseWebVTT(vttByteArray: ArrayBuffer, initPTS: number, timescale: number, vttCCs: VTTCCs, cc: number, timeOffset: number, callBack: undefined, errorCallBack: undefined) source

import {parseWebVTT} from 'hls.js/src/utils/webvtt-parser.ts'

Params:

NameTypeAttributeDescription
vttByteArray ArrayBuffer
initPTS number
timescale number
vttCCs VTTCCs
cc number
timeOffset number
callBack undefined
errorCallBack undefined

public pdtWithinToleranceTest(pdtBufferEnd: number, maxFragLookUpTolerance: number, candidate: Fragment): boolean source

import {pdtWithinToleranceTest} from 'hls.js/src/controller/fragment-finders.ts'

The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions. This function tests the candidate's program date time values, as represented in Unix time

Params:

NameTypeAttributeDescription
pdtBufferEnd number
maxFragLookUpTolerance number
candidate Fragment

Return:

boolean

public probe(data: Uint8Array, offset: number): boolean source

import {probe} from 'hls.js/src/demux/adts.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public probe(data: Uint8Array, offset: number): boolean source

import {probe} from 'hls.js/src/demux/mpegaudio.ts'

Params:

NameTypeAttributeDescription
data Uint8Array
offset number

Return:

boolean

public readSint32(buffer: Uint8Array, offset: number): number source

import {readSint32} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
buffer Uint8Array
offset number

Return:

number

public readUint16(buffer: Uint8Array, offset: number): number source

import {readUint16} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
buffer Uint8Array
offset number

Return:

number

public readUint32(buffer: Uint8Array, offset: number): number source

import {readUint32} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
buffer Uint8Array
offset number

Return:

number

public removeCuesInRange(track: TextTrack, start: number, end: number, predicate: undefined) source

import {removeCuesInRange} from 'hls.js/src/utils/texttrack-utils.ts'

Params:

NameTypeAttributeDescription
track TextTrack
start number
end number
predicate undefined

public removePadding(array: Uint8Array): Uint8Array source

import {removePadding} from 'hls.js/src/crypt/aes-decryptor.ts'

Params:

NameTypeAttributeDescription
array Uint8Array

Return:

Uint8Array

public segmentValidRange(data: Uint8Array): SegmentedRange source

import {segmentValidRange} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

SegmentedRange

public sendAddTrackEvent(track: TextTrack, videoEl: HTMLMediaElement) source

import {sendAddTrackEvent} from 'hls.js/src/utils/texttrack-utils.ts'

Params:

NameTypeAttributeDescription
track TextTrack
videoEl HTMLMediaElement

public shouldAlignOnDiscontinuities(lastFrag: undefined, lastLevel: Level, details: LevelDetails): boolean source

import {shouldAlignOnDiscontinuities} from 'hls.js/src/utils/discontinuities.ts'

Params:

NameTypeAttributeDescription
lastFrag undefined
lastLevel Level
details LevelDetails

Return:

boolean

public sliceUint8(array: Uint8Array, start: number, end: number): Uint8Array source

import {sliceUint8} from 'hls.js/src/utils/typed-array.ts'

Params:

NameTypeAttributeDescription
array Uint8Array
start number
end number

Return:

Uint8Array

public toMpegTsClockFromTimescale(value: number, srcScale: number): number source

import {toMpegTsClockFromTimescale} from 'hls.js/src/utils/timescale-conversion.ts'

Params:

NameTypeAttributeDescription
value number
srcScale number

Return:

number

public toMsFromMpegTsClock(value: number, round: boolean): number source

import {toMsFromMpegTsClock} from 'hls.js/src/utils/timescale-conversion.ts'

Params:

NameTypeAttributeDescription
value number
round boolean

Return:

number

public toTimescaleFromBase(value: undefined, destScale: number, srcBase: number, round: boolean): number source

import {toTimescaleFromBase} from 'hls.js/src/utils/timescale-conversion.ts'

Params:

NameTypeAttributeDescription
value undefined
destScale number
srcBase number
round boolean

Return:

number

public toTimescaleFromScale(value: undefined, destScale: number, srcScale: number, round: boolean): number source

import {toTimescaleFromScale} from 'hls.js/src/utils/timescale-conversion.ts'

Params:

NameTypeAttributeDescription
value undefined
destScale number
srcScale number
round boolean

Return:

number

public updateFragPTSDTS(details: undefined, frag: Fragment, startPTS: number, endPTS: number, startDTS: number, endDTS: number): number source

import {updateFragPTSDTS} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
details undefined
frag Fragment
startPTS number
endPTS number
startDTS number
endDTS number

Return:

number

public updatePTS(fragments: undefined, fromIdx: number, toIdx: number) source

import {updatePTS} from 'hls.js/src/controller/level-helper.ts'

Params:

NameTypeAttributeDescription
fragments undefined
fromIdx number
toIdx number

public utf8ArrayToStr(array: *, exitOnNull: boolean): * source

import {utf8ArrayToStr} from 'hls.js/src/demux/id3.ts'

Params:

NameTypeAttributeDescription
array *
exitOnNull boolean
  • optional
  • default: false

Return:

*

public writeUint32(buffer: Uint8Array, offset: number, value: number) source

import {writeUint32} from 'hls.js/src/utils/mp4-tools.ts'

Params:

NameTypeAttributeDescription
buffer Uint8Array
offset number
value number