Members
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_BOX |
0 | number | |
FULL_BOX |
1 | number |
- Source:
boxDefinitions_ :Object.<number, !shaka.util.Mp4Parser.CallbackType>
Type:
- Object.<number, !shaka.util.Mp4Parser.CallbackType>
- Source:
headers_ :Object.<number, shaka.util.Mp4Parser.BoxType_>
Type:
- Object.<number, shaka.util.Mp4Parser.BoxType_>
- Source:
Methods
allData(callback) → {shaka.util.Mp4Parser.CallbackType}
Create a callback that tells the Mp4 parser to treat the body of a box as a
binary blob and to parse the body's contents using the provided callback.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function(!Uint8Array) |
- Source:
Returns:
audioSampleEntry(boxnon-null)
A callback that tells the Mp4 parser to treat the body of a box as a audio
sample entry. A audio sample entry has some fixed-sized fields
describing the audio codec parameters, followed by an arbitrary number of
appended children. Each child is a box.
Parameters:
Name | Type | Description |
---|---|---|
box |
shaka.extern.ParsedBox |
- Source:
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 |
---|---|---|
box |
shaka.extern.ParsedBox |
- Source:
headerSize(box) → {number}
Find the header size of the box.
Useful for modifying boxes in place or finding the exact offset of a field.
Parameters:
Name | Type | Description |
---|---|---|
box |
shaka.extern.ParsedBox |
- Source:
Returns:
- Type
- number
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 |
---|---|---|
box |
shaka.extern.ParsedBox |
- Source:
typeFromString_(name) → {number}
Convert an ascii string name to the integer type for a box.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the box. The name must be four characters long. |
- Source:
Returns:
- Type
- number
typeToString(type) → {string}
Convert an integer type from a box into an ascii string name.
Useful for debugging.
Parameters:
Name | Type | Description |
---|---|---|
type |
number | The type of the box, a uint32. |
- Source:
Returns:
- Type
- string
visualSampleEntry(boxnon-null)
A callback that tells the Mp4 parser to treat the body of a box as a visual
sample entry. A visual sample entry has some fixed-sized fields
describing the video codec parameters, followed by an arbitrary number of
appended children. Each child is a box.
Parameters:
Name | Type | Description |
---|---|---|
box |
shaka.extern.ParsedBox |
- Source:
box(type, definitionnon-null) → {shaka.util.Mp4Parser}
Declare a box type as a Box.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | |
definition |
shaka.util.Mp4Parser.CallbackType |
- Source:
Returns:
- Type
- shaka.util.Mp4Parser
fullBox(type, definitionnon-null) → {shaka.util.Mp4Parser}
Declare a box type as a Full Box.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | |
definition |
shaka.util.Mp4Parser.CallbackType |
- Source:
Returns:
- Type
- shaka.util.Mp4Parser
parse(datanon-null, partialOkayopt, stopOnPartialopt)
Parse the given data using the added callbacks.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
BufferSource | ||
partialOkay |
boolean |
<optional> |
If true, allow reading partial payloads from some boxes. If the goal is a child box, we can sometimes find it without enough data to find all child boxes. |
stopOnPartial |
boolean |
<optional> |
If true, stop reading if an incomplete box is detected. |
- Source:
parseNext(absStart, readernon-null, partialOkayopt, stopOnPartialopt)
Parse the next box on the current level.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
absStart |
number | The absolute start position in the original byte array. | |
reader |
shaka.util.DataViewReader | ||
partialOkay |
boolean |
<optional> |
If true, allow reading partial payloads from some boxes. If the goal is a child box, we can sometimes find it without enough data to find all child boxes. |
stopOnPartial |
boolean |
<optional> |
If true, stop reading if an incomplete box is detected. |
- Source:
stop()
Stop parsing. Useful for extracting information from partial segments and
avoiding an out-of-bounds error once you find what you are looking for.
- Source: