Skip to content

Function: writeStz2() ​

ts
function writeStz2(cursor, box): void;

Defined in: writers/writeStz2.ts:30

Write the stz2 box (CompactSampleSizeBox).

ISO/IEC 14496-12:2015 - 8.7.3

The writer writes entries of 4, 8, or 16 bits. With a fieldSize of 4, the last byte has 0 in its low bits for an odd number of entries.

Parameters ​

cursor ​

IsoBoxWriteCursor

The write cursor

box ​

CompactSampleSizeBox

The CompactSampleSizeBox fields to write

Returns ​

void

Throws ​

RangeError if a value of the box does not fit its field.

Example ​

ts
const bytes = writeIsoBox(
	{ type: 'stz2', version: 0, flags: 0, fieldSize: 8, entrySize: [5, 6] },
	{ writers: { stz2: writeStz2 } },
)

A Streaming Video Technology Alliance project.