Class: shaka.util.TsParser

Members

PacketLength_ :number

Type:
  • number
Source:

Timescale_ :number

Type:
  • number
Source:

audioCodec_ :string

Type:
  • string
Source:

audioData_ :Array.<Uint8Array>

Type:
  • Array.<Uint8Array>
Source:

audioPid_ :number

Type:
  • number
Source:

audioStartTime_ :number

Type:
  • number
Source:

id3Data_ :Array.<Uint8Array>

Type:
  • Array.<Uint8Array>
Source:

id3Pid_ :number

Type:
  • number
Source:

pmtId_ :number

Type:
  • number
Source:

pmtParsed_ :boolean

Type:
  • boolean
Source:

videoCodec_ :string

Type:
  • string
Source:

videoData_ :Array.<Uint8Array>

Type:
  • Array.<Uint8Array>
Source:

videoPid_ :number

Type:
  • number
Source:

videoStartTime_ :number

Type:
  • number
Source:

Methods

probe(data) → {boolean}

Check if the passed data corresponds to an MPEG2-TS
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
boolean

syncOffset(data) → {number}

Returns the synchronization offset
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
number

getCodecs() → {{audio: ?string, video: ?string}}

Return the audio and video codecs
Source:
Returns:
Type
{audio: ?string, video: ?string}

getMetadata() → {Array.<shaka.extern.ID3Metadata>}

Return the ID3 metadata
Source:
Returns:
Type
Array.<shaka.extern.ID3Metadata>

getPmtId_(data, offset) → {number}

Get the PMT ID from the PAT
Parameters:
Name Type Description
data Uint8Array
offset number
Source:
Returns:
Type
number

getStartTime() → {{audio: ?number, video: ?number}}

Return the start time for the audio and video
Source:
Returns:
Type
{audio: ?number, video: ?number}

parse(data) → {shaka.util.TsParser}

Parse the given data
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
shaka.util.TsParser

parsePES(data) → {shaka.util.TsParser.PES}

Parse PES
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
shaka.util.TsParser.PES

parsePMT(data, offset) → {shaka.util.TsParser.PMT}

Parse PMT
Parameters:
Name Type Description
data Uint8Array
offset number
Source:
Returns:
Type
shaka.util.TsParser.PMT

Type Definitions

PES

PES.

Type:
  • {data: Uint8Array, packetLength: number, pts: ?number, dts: ?number}
Properties:
Name Type Attributes Description
data Uint8Array
packetLength number
pts number <nullable>
dts number <nullable>
Source:

PMT

PMT.

Type:
  • {audio: number, video: number, id3: number, audioCodec: string, videoCodec: string}
Properties:
Name Type Description
audio number Audio PID
video number Video PID
id3 number ID3 PID
audioCodec string Audio codec
videoCodec string Video codec
Source: