Skip to content

Function: writeStsz() ​

ts
function writeStsz(cursor, box): void;

Defined in: writers/writeStsz.ts:23

Write the stsz box (SampleSizeBox).

ISO/IEC 14496-12:2015 - 8.7.3

Parameters ​

cursor ​

IsoBoxWriteCursor

The write cursor

box ​

SampleSizeBox

The SampleSizeBox fields to write

Returns ​

void

Throws ​

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

Example ​

ts
const box = {
	type: 'stsz' as const,
	version: 0,
	flags: 0,
	sampleSize: 1024,
	sampleCount: 100,
}

const writer = writeIsoBox(box, { writers: { stsz: writeStsz } })
const buffer = new Uint8Array(writer.buffer)

A Streaming Video Technology Alliance project.