Home Reference Source
import TSDemuxer from 'hls.js/src/demux/tsdemuxer.ts'
public class | source

TSDemuxer

Static Method Summary

Static Public Methods
public static

createTrack(type: undefined, duration: number): DemuxedTrack

Creates a track model internal to demuxer used to drive remuxing input

public static

probe(data: Uint8Array): *

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public

config: HlsConfig

public

observer: HlsEventEmitter

public
public
public
public

typeSupported: TypeSupported

public
Private Members
private

_audioTrack: DemuxedAudioTrack

private

_avcTrack: DemuxedAvcTrack

private
private

_id3Track: DemuxedMetadataTrack

private
private

_txtTrack: DemuxedUserdataTrack

Method Summary

Public Methods
public

decrypt(demuxResult: DemuxerResult, sampleAes: SampleAesDecrypter): Promise

public

demux(data: Uint8Array, timeOffset: number, isSampleAes: undefined, flush: undefined): DemuxerResult

public

demuxSampleAes(data: Uint8Array, keyData: KeyData, timeOffset: number): Promise

public
public

extractRemainingSamples(demuxResult: DemuxerResult)

public

flush(): *

public

getLastNalUnit(samples: undefined): *

public

parseAACPES(track: DemuxedAudioTrack, pes: PES)

public

parseAVCNALu(track: DemuxedAvcTrack, array: Uint8Array): Array

public

parseAVCPES(track: DemuxedAvcTrack, textTrack: DemuxedUserdataTrack, pes: PES, last: boolean)

public

parseID3PES(id3Track: DemuxedMetadataTrack, pes: PES)

public

parseMPEGPES(track: DemuxedAudioTrack, pes: PES)

public
public

resetInitSegment(initSegment: undefined, audioCodec: string, videoCodec: string, trackDuration: number)

Initializes a new init segment on the demuxer/remuxer interface.

public

Static Public Methods

public static createTrack(type: undefined, duration: number): DemuxedTrack source

Creates a track model internal to demuxer used to drive remuxing input

Params:

NameTypeAttributeDescription
type undefined
duration number

Return:

DemuxedTrack

public static probe(data: Uint8Array): * source

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

*

Public Constructors

public constructor() source

Public Members

public aacOverFlow: * source

public audioCodec: string source

public avcSample: * source

public config: HlsConfig source

public observer: HlsEventEmitter source

public pmtParsed: boolean source

public remainderData: * source

public sampleAes: * source

public typeSupported: TypeSupported source

public videoCodec: string source

Private Members

private _audioTrack: DemuxedAudioTrack source

private _avcTrack: DemuxedAvcTrack source

private _duration: number source

private _id3Track: DemuxedMetadataTrack source

private _pmtId: number source

private _txtTrack: DemuxedUserdataTrack source

Public Methods

public decrypt(demuxResult: DemuxerResult, sampleAes: SampleAesDecrypter): Promise source

Params:

NameTypeAttributeDescription
demuxResult DemuxerResult
sampleAes SampleAesDecrypter

Return:

Promise

public demux(data: Uint8Array, timeOffset: number, isSampleAes: undefined, flush: undefined): DemuxerResult source

Params:

NameTypeAttributeDescription
data Uint8Array
timeOffset number
isSampleAes undefined
flush undefined

Return:

DemuxerResult

public demuxSampleAes(data: Uint8Array, keyData: KeyData, timeOffset: number): Promise source

Params:

NameTypeAttributeDescription
data Uint8Array
keyData KeyData
timeOffset number

Return:

Promise

public destroy() source

public extractRemainingSamples(demuxResult: DemuxerResult) source

Params:

NameTypeAttributeDescription
demuxResult DemuxerResult

public flush(): * source

Return:

*

public getLastNalUnit(samples: undefined): * source

Params:

NameTypeAttributeDescription
samples undefined

Return:

*

public parseAACPES(track: DemuxedAudioTrack, pes: PES) source

Params:

NameTypeAttributeDescription
track DemuxedAudioTrack
pes PES

public parseAVCNALu(track: DemuxedAvcTrack, array: Uint8Array): Array source

Params:

NameTypeAttributeDescription
track DemuxedAvcTrack
array Uint8Array

Return:

Array

public parseAVCPES(track: DemuxedAvcTrack, textTrack: DemuxedUserdataTrack, pes: PES, last: boolean) source

Params:

NameTypeAttributeDescription
track DemuxedAvcTrack
textTrack DemuxedUserdataTrack
pes PES
last boolean

public parseID3PES(id3Track: DemuxedMetadataTrack, pes: PES) source

Params:

NameTypeAttributeDescription
id3Track DemuxedMetadataTrack
pes PES

public parseMPEGPES(track: DemuxedAudioTrack, pes: PES) source

Params:

NameTypeAttributeDescription
track DemuxedAudioTrack
pes PES

public resetContiguity() source

public resetInitSegment(initSegment: undefined, audioCodec: string, videoCodec: string, trackDuration: number) source

Initializes a new init segment on the demuxer/remuxer interface. Needed for discontinuities/track-switches (or at stream start) Resets all internal track instances of the demuxer.

Params:

NameTypeAttributeDescription
initSegment undefined
audioCodec string
videoCodec string
trackDuration number

public resetTimeStamp() source