Constructor
new Mp4Parser()
Create a new MP4 Parser
- Source:
Members
-
(private, static) BoxType_ :number
-
An enum used to track the type of box so that the correct values can be read from the header.
Type:
- number
Properties:
Name Value Type Description BASIC_BOX0 number FULL_BOX1 number - Source:
-
(private, non-null) boxDefinitions_ :Object.<number, !shaka.util.Mp4Parser.CallbackType>
-
Type:
- Object.<number, !shaka.util.Mp4Parser.CallbackType>
- Source:
-
(private, non-null) headers_ :Object.<number, shaka.util.Mp4Parser.BoxType_>
-
Type:
- Object.<number, shaka.util.Mp4Parser.BoxType_>
- Source:
Methods
-
(static) allData(callbacknon-null) → (non-null) {shaka.util.Mp4Parser.CallbackType}
-
Create a callback that tells the Mp4 parser to treat the body of a box as a binary blob and how to handle it.
Parameters:
Name Type Description callback!function(!Uint8Array) - Source:
Returns:
-
(static) children(boxnon-null)
-
A callback that tells the Mp4 parser to treat the body of a box as a series of boxes. The number of boxes is limited by the size of the parent box.
Parameters:
Name Type Description boxshaka.util.Mp4Parser.ParsedBox - Source:
-
(static) sampleDescription(boxnon-null)
-
A callback that tells the Mp4 parser to treat the body of a box as a sample description. A sample description box has a fixed number of children. The number of children is represented by a 4 byte unsigned integer. Each child is a box.
Parameters:
Name Type Description boxshaka.util.Mp4Parser.ParsedBox - Source:
-
(private, static) typeFromString_(name) → {number}
-
Convert an ascii string name to the integer type for a box.
Parameters:
Name Type Description namestring The name of the box. The name must be four characters long. - Source:
Returns:
- Type
- number
-
box(type, definitionnon-null) → (non-null) {shaka.util.Mp4Parser}
-
Delcare a box type as a Box.
Parameters:
Name Type Description typestring definitionshaka.util.Mp4Parser.CallbackType - Source:
Returns:
- Type
- shaka.util.Mp4Parser
-
fullBox(type, definitionnon-null) → (non-null) {shaka.util.Mp4Parser}
-
Declare a box type as a Full Box.
Parameters:
Name Type Description typestring definitionshaka.util.Mp4Parser.CallbackType - Source:
Returns:
- Type
- shaka.util.Mp4Parser
-
parse(datanon-null)
-
Parse the given data using the added callbacks.
Parameters:
Name Type Description dataArrayBuffer - Source:
-
parseNext(absStart, readernon-null)
-
Parse the next box on the current level.
Parameters:
Name Type Description absStartnumber The absolute start position in the original byte array readershaka.util.DataViewReader - Source:
Type Definitions
-
CallbackType
-
Type:
- function(!shaka.util.Mp4Parser.ParsedBox)
- Source:
-
ParsedBox
-
Type:
- {parser: !shaka.util.Mp4Parser, start: number, size: number, version: ?number, flags: ?number, reader: !shaka.util.DataViewReader}
Properties:
Name Type Attributes Description parsershaka.util.Mp4Parser The parser that parsed this box. The parser can be used to parse child boxes where the configuration of the current parser is needed to parsed other boxes. startnumber The start of this box (before the header) in the original buffer. This start position is the absolute position. sizenumber The size of this box (including the header). versionnumber <nullable>
The version for a full box, null for basic boxes. flagsnumber <nullable>
The flags for a full box, null for basic boxes. readershaka.util.DataViewReader The reader for this box is only for this box. Reading or not reading to the end will have no affect on the parser reading other sibling boxes. - Source: