Class: shaka.media.Transmuxer

Constructor

new Transmuxer()

Transmuxer provides all operations for transmuxing from Transport Stream to MP4.
Implements:
Source:

Members

(private, non-null) captions_ :Array.<muxjs.mp4.ClosedCaption>

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

(private) isTransmuxing_ :boolean

Type:
  • boolean
Source:

(private) muxTransmuxer_ :muxjs.mp4.Transmuxer

Type:
  • muxjs.mp4.Transmuxer
Source:

(private, non-null) transmuxedData_ :Array.<!Uint8Array>

Type:
  • Array.<!Uint8Array>
Source:

Methods

(static) 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

(static) 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

(static) isTsContainer(mimeType) → {boolean}

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

(export) destroy() → (non-null) {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

(private) onTransmuxDone_()

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

(private) 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(datanon-null) → (non-null) {Promise.<{data: !Uint8Array, captions: !Array.<!muxjs.mp4.ClosedCaption>}>}

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