Function: beginIsoFullBox()
ts
function beginIsoFullBox(
cursor,
type,
version,
flags
): number;Defined in: beginIsoFullBox.ts:22
Writes a full box header with no size: the header, the version, and the flags. endIsoBox writes the size.
Parameters
cursor
The cursor to write to.
type
string
The four-character code of the box.
version
number
The version of the box.
flags
number
The flags of the box.
Returns
number
The position of the first byte of the box. Pass it to endIsoBox.
Throws
RangeError if type does not have 4 characters of 1 byte each, or version or flags does not fit its field.
Example
ts
const cursor = createIsoBoxWriteCursor()
const start = beginIsoFullBox(cursor, 'mfhd', 0, 0)
writeUint32(cursor, 7) // sequence_number
endIsoBox(cursor, start)
const bytes = cursor.bytes.subarray(0, cursor.pos)