Class: shaka.media.Transmuxer

Constructor

new Transmuxer()

Implements:
Source:

Members

captions_ :Array.<muxjs.mp4.ClosedCaption>

Type:
  • Array.<muxjs.mp4.ClosedCaption>
Source:

isTransmuxing_ :boolean

Type:
  • boolean
Source:

metadata_ :Array.<muxjs.mp4.Metadata>

Type:
  • Array.<muxjs.mp4.Metadata>
Source:

muxjs_ :muxjs

Type:
  • muxjs
Source:

muxTransmuxer_ :muxjs.mp4.Transmuxer

Type:
  • muxjs.mp4.Transmuxer
Source:

transmuxedData_ :Array.<!Uint8Array>

Type:
  • Array.<!Uint8Array>
Source:

Methods

convertTsCodecs(contentType, tsMimeType) → {string}

For transport stream, convert its codecs to MP4 codecs.
Parameters:
Name Type Description
contentType string
tsMimeType string
Source:
Returns:
Type
string

isSupported(mimeType, contentTypeopt) → {boolean}

Check if the content type is Transport Stream, and if muxjs is loaded.
Parameters:
Name Type Attributes Description
mimeType string
contentType string <optional>
Source:
Returns:
Type
boolean

isTsContainer(mimeType) → {boolean}

Check if the mimetype contains 'mp2t'.
Parameters:
Name Type Description
mimeType string
Source:
Returns:
Type
boolean

destroy() → {Promise}

Request that this object be destroyed, releasing all resources and shutting down all operations. Returns a Promise which is resolved when destruction is complete. This Promise should never be rejected.
Implements:
Source:
Returns:
Type
Promise

onTransmuxDone_()

Handles the 'done' event of the transmuxer. Resolves the transmux Promise, and returns the transmuxed data.
Source:

onTransmuxed_(segment)

Handles the 'data' event of the transmuxer. Extracts the cues from the transmuxed segment, and adds them to an array. Stores the transmuxed data in another array, to pass it back to MediaSourceEngine, and append to the source buffer.
Parameters:
Name Type Description
segment muxjs.mp4.Transmuxer.Segment
Source:

transmux(data) → {Promise.<{data: !Uint8Array, captions: !Array.<!muxjs.mp4.ClosedCaption>, metadata: !Array.<!Object>}>}

Transmux from Transport stream to MP4, using the mux.js library.
Parameters:
Name Type Description
data BufferSource
Source:
Returns:
Type
Promise.<{data: !Uint8Array, captions: !Array.<!muxjs.mp4.ClosedCaption>, metadata: !Array.<!Object>}>