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

TSDemuxer

Static Method Summary

Static Public Methods
public static

createTrack(type: string, duration: number): object

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

public static

probe(data: *): boolean

Static Private Methods
private static

_syncOffset(data: *): *

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public

config: *

public
public
public
public
public

remuxer: *

public
public
public
Private Members
private
private
private
private
private
private

_pmtId: *

private

Method Summary

Public Methods
public

append(data: *, timeOffset: *, contiguous: *, accurateTimeOffset: *)

public

decryptAndRemux(audioTrack: *, videoTrack: *, id3Track: *, textTrack: *, timeOffset: *, contiguous: *, accurateTimeOffset: *)

public

decryptAndRemuxAvc(audioTrack: *, videoTrack: *, id3Track: *, textTrack: *, timeOffset: *, contiguous: *, accurateTimeOffset: *)

public
public

discardEPB(data: *): *

remove Emulation Prevention bytes from a RBSP

public

pushAccesUnit(avcSample: *, avcTrack: *)

public

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

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

public
public

setDecryptData(decryptdata: *)

Private Methods
private
private

_insertSampleInOrder(arr: *, data: *)

private

_parseAACPES(pes: *)

private

_parseAVCNALu(array: *): *

private

_parseAVCPES(pes: *, last: *)

private

_parseID3PES(pes: *)

private

_parseMPEGPES(pes: *)

private

_parsePAT(data: *, offset: *): *

private

_parsePES(stream: *): *

private

_parsePMT(data: *, offset: *, mpegSupported: *, isSampleAes: *): *

private

_trackUnknownPmt(type: *, logLevel: *, message: *): *

Static Public Methods

public static createTrack(type: string, duration: number): object source

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

Params:

NameTypeAttributeDescription
type string

'audio' | 'video' | 'id3' | 'text'

duration number

Return:

object

TSDemuxer's internal track model

public static probe(data: *): boolean source

Params:

NameTypeAttributeDescription
data *

Return:

boolean

Static Private Methods

private static _syncOffset(data: *): * source

Params:

NameTypeAttributeDescription
data *

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: * source

public observer: * source

public pmtParsed: boolean source

public pmtUnknownTypes: {} source

public remuxer: * source

public sampleAes: * source

public typeSupported: * source

public videoCodec: * source

Private Members

private _audioTrack: * source

private _avcTrack: * source

private _duration: * source

private _id3Track: * source

private _initPTS: * source

private _pmtId: * source

private _txtTrack: * source

Public Methods

public append(data: *, timeOffset: *, contiguous: *, accurateTimeOffset: *) source

Params:

NameTypeAttributeDescription
data *
timeOffset *
contiguous *
accurateTimeOffset *

public decryptAndRemux(audioTrack: *, videoTrack: *, id3Track: *, textTrack: *, timeOffset: *, contiguous: *, accurateTimeOffset: *) source

Params:

NameTypeAttributeDescription
audioTrack *
videoTrack *
id3Track *
textTrack *
timeOffset *
contiguous *
accurateTimeOffset *

public decryptAndRemuxAvc(audioTrack: *, videoTrack: *, id3Track: *, textTrack: *, timeOffset: *, contiguous: *, accurateTimeOffset: *) source

Params:

NameTypeAttributeDescription
audioTrack *
videoTrack *
id3Track *
textTrack *
timeOffset *
contiguous *
accurateTimeOffset *

public destroy() source

public discardEPB(data: *): * source

remove Emulation Prevention bytes from a RBSP

Params:

NameTypeAttributeDescription
data *

Return:

*

public pushAccesUnit(avcSample: *, avcTrack: *) source

Params:

NameTypeAttributeDescription
avcSample *
avcTrack *

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

(in TS timescale = 90kHz)

public resetTimeStamp() source

public setDecryptData(decryptdata: *) source

Params:

NameTypeAttributeDescription
decryptdata *

Private Methods

private _getLastNalUnit(): * source

Return:

*

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

Params:

NameTypeAttributeDescription
arr *
data *

private _parseAACPES(pes: *) source

Params:

NameTypeAttributeDescription
pes *

private _parseAVCNALu(array: *): * source

Params:

NameTypeAttributeDescription
array *

Return:

*

private _parseAVCPES(pes: *, last: *) source

Params:

NameTypeAttributeDescription
pes *
last *

private _parseID3PES(pes: *) source

Params:

NameTypeAttributeDescription
pes *

private _parseMPEGPES(pes: *) source

Params:

NameTypeAttributeDescription
pes *

private _parsePAT(data: *, offset: *): * source

Params:

NameTypeAttributeDescription
data *
offset *

Return:

*

private _parsePES(stream: *): * source

Params:

NameTypeAttributeDescription
stream *

Return:

*

private _parsePMT(data: *, offset: *, mpegSupported: *, isSampleAes: *): * source

Params:

NameTypeAttributeDescription
data *
offset *
mpegSupported *
isSampleAes *

Return:

*

private _trackUnknownPmt(type: *, logLevel: *, message: *): * source

Params:

NameTypeAttributeDescription
type *
logLevel *
message *

Return:

*