Function: endIsoBox()
ts
function endIsoBox(cursor, start): void;Defined in: endIsoBox.ts:17
Writes the size of a box into its header. The size is the number of bytes from start to cursor.pos.
Parameters
cursor
The cursor at the first byte after the box.
start
number
The position that beginIsoBox or beginIsoFullBox returned.
Returns
void
Throws
RangeError if the box has more than 2^32 - 1 bytes. The message has the box type and the size.
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)