Function: readIsoBoxes()
Call Signature
ts
function readIsoBoxes<R>(raw, config): IsoBoxReaderReturn<R>[];Defined in: libs/iso-bmff/src/readIsoBoxes.ts:21
Reads ISO boxes from a data source.
Type Parameters
R
R extends IsoBoxReaderMap
Parameters
raw
The raw ISO data
config
IsoBoxReadViewConfig & object
The configuration for the IsoView
Returns
IsoBoxReaderReturn<R>[]
The parsed boxes
Example
ts
// Sample 'ftyp' box (20 bytes)
const bytes = new Uint8Array([
0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6f, 0x6d, 0x00, 0x00, 0x00,
0x01, 0x69, 0x73, 0x6f, 0x6d,
])
const boxes = readIsoBoxes(bytes.buffer, { readers: { ftyp: readFtyp, stsd: readStsd } })
assert.strictEqual(boxes.length, 1)
const box = boxes[0]
assert.strictEqual(box.type, 'ftyp')
assert.strictEqual(box.size, 20)
assert.strictEqual(box.majorBrand, 'isom')
assert.strictEqual(box.minorVersion, 1)
assert.deepEqual(box.compatibleBrands, ['isom'])Call Signature
ts
function readIsoBoxes(raw, config?): ParsedIsoBox[];Defined in: libs/iso-bmff/src/readIsoBoxes.ts:29