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
Static Private Methods
private static

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public

config: *

public
public
public
public
public
public
public
Private Members
private
private
private
private
private
private
private
private

Method Summary

Public Methods
public

decrypt(audioTrack: DemuxedAudioTrack, videoTrack: DemuxedVideoTrack, 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

remove Emulation Prevention bytes from a RBSP

public

extractRemainingSamples(demuxResult: DemuxerResult)

public

flush(): *

public

pushAccessUnit(avcSample: undefined, avcTrack: undefined)

public
public

resetInitSegment(audioCodec: string, videoCodec: string, duration: number)

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

public
Private Methods
private
private
private

_parseAACPES(pes: PES)

private
private

_parseAVCPES(pes: PES, last: boolean)

private

_parseID3PES(pes: PES)

private

_parseMPEGPES(pes: PES)

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): boolean source

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

boolean

Static Private Methods

private static _syncOffset(data: Uint8Array): * source

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

*

Public Constructors

public constructor() source

Public Members

public aacLastPTS: * source

public aacOverFlow: * source

public audioCodec: * source

public avcSample: * source

public config: * source

public contiguous: boolean source

public observer: * source

public pmtParsed: boolean source

public remainderData: * source

public sampleAes: * source

public typeSupported: * source

public videoCodec: * source

Private Members

private _audioTrack: * source

private _avcTrack: * source

private _duration: number source

private _id3Track: * source

private _initDTS: * source

private _initPTS: * source

private _pmtId: number source

private _txtTrack: * source

Public Methods

public decrypt(audioTrack: DemuxedAudioTrack, videoTrack: DemuxedVideoTrack, sampleAes: SampleAesDecrypter): Promise source

Params:

NameTypeAttributeDescription
audioTrack DemuxedAudioTrack
videoTrack DemuxedVideoTrack
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 discardEPB(data: Uint8Array): Uint8Array source

remove Emulation Prevention bytes from a RBSP

Params:

NameTypeAttributeDescription
data Uint8Array

Return:

Uint8Array

public extractRemainingSamples(demuxResult: DemuxerResult) source

Params:

NameTypeAttributeDescription
demuxResult DemuxerResult

public flush(): * source

Return:

*

public pushAccessUnit(avcSample: undefined, avcTrack: undefined) source

Params:

NameTypeAttributeDescription
avcSample undefined
avcTrack undefined

public resetContiguity() source

public resetInitSegment(audioCodec: string, videoCodec: string, duration: 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
audioCodec string
videoCodec string
duration number

public resetTimeStamp() source

Private Methods

private _getLastNalUnit(): * source

Return:

*

private _insertSampleInOrder(arr: undefined, data: undefined) source

Params:

NameTypeAttributeDescription
arr undefined
data undefined

private _parseAACPES(pes: PES) source

Params:

NameTypeAttributeDescription
pes PES

private _parseAVCNALu(array: Uint8Array): Array source

Params:

NameTypeAttributeDescription
array Uint8Array

Return:

Array

private _parseAVCPES(pes: PES, last: boolean) source

Params:

NameTypeAttributeDescription
pes PES
last boolean

private _parseID3PES(pes: PES) source

Params:

NameTypeAttributeDescription
pes PES

private _parseMPEGPES(pes: PES) source

Params:

NameTypeAttributeDescription
pes PES