Function: readVisualSampleEntry()
ts
function readVisualSampleEntry<T, V>(cursor, type): VisualSampleEntry<T, V>;Defined in: readers/readVisualSampleEntry.ts:30
Read a visual sample entry box (VisualSampleEntry) of the given type.
ISO/IEC 14496-12:2015 - 12.1.3
The readers map takes the function under a key of IsoBoxMap, such as av01 or vp09. For a box type that the package does not name, add the box type to IsoCustomBoxMap first.
Type Parameters
T
T extends string
V
V extends IsoInt64
Parameters
cursor
The read cursor at the first byte after the box header
type
T
The type of VisualSampleEntry to read
Returns
VisualSampleEntry<T, V>
A parsed VisualSampleEntry
Example
ts
// A vp09 sample entry of 86 bytes: the box header, then the visual sample entry fields, all 0.
const bytes = new Uint8Array(86)
new DataView(bytes.buffer).setUint32(0, 86)
bytes.set([0x76, 0x70, 0x30, 0x39], 4)
const [entry] = readIsoBoxes(bytes, {
readers: {
vp09: readVisualSampleEntry,
},
})