Function: readPssh()
ts
function readPssh(cursor): ProtectionSystemSpecificHeaderBox;Defined in: readers/readPssh.ts:21
Read the pssh box (ProtectionSystemSpecificHeaderBox).
Parameters
cursor
The read cursor at the first byte after the box header
Returns
ProtectionSystemSpecificHeaderBox
A parsed ProtectionSystemSpecificHeaderBox
Example
ts
// A version 1 pssh box: size, type, version and flags, SystemID, KID_count (1),
// the 16 bytes of the KID, DataSize (4), then the Data.
const bytes = new Uint8Array([
0, 0, 0, 56, 112, 115, 115, 104, 1, 0, 0, 0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0, 0, 0, 1, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0, 0, 0, 4, 1, 2, 3, 4,
])
const [pssh] = readIsoBoxes(bytes, { readers: { pssh: readPssh } })