Skip to content

Function: writeFtyp() ​

ts
function writeFtyp(cursor, box): void;

Defined in: writers/writeFtyp.ts:24

Write the ftyp box (FileTypeBox).

ISO/IEC 14496-12:2015 - 4.3

Parameters ​

cursor ​

IsoBoxWriteCursor

The write cursor

box ​

FileTypeBox

The FileTypeBox fields to write

Returns ​

void

Throws ​

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

Throws ​

RangeError if majorBrand or a compatible brand does not have 4 characters.

Example ​

ts
const box = {
	type: 'ftyp' as const,
	majorBrand: 'isom',
	minorVersion: 1,
	compatibleBrands: ['isom'],
}

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

A Streaming Video Technology Alliance project.