The boxes to search through
A function that accepts a box and returns true if it matches
Optionalconfig: TraverseIsoBoxesConfigConfiguration options for traversal
An array of boxes that satisfy the callback
const isoFile = await readFile('test/fixtures/captions.mp4')
const boxes = readIsoBoxes(new Uint8Array(isoFile), { readers: { ftyp: readFtyp } })
const filtered = filterIsoBoxes(boxes, box => box.type === 'ftyp')
const ftyp = filtered[0]
assert.ok(ftyp)
assert.strictEqual(ftyp.type, 'ftyp')
assert.strictEqual(ftyp.majorBrand, 'isom')
Optionalconfig: TraverseIsoBoxesConfig
Filters boxes in the tree that satisfy the provided testing function.
This function traverses the entire box structure (including nested boxes) and returns all boxes for which the callback returns true.