Beta
Extracts the content ID from InitData using skd:// URI or query parameters.
The initialization data (PSSH box)
The extracted content ID
const initData = new Uint8Array([0x88, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x2f, 0x00, 0x2f, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00]);strictEqual(extractContentId(initData.buffer), '1234'); Copy
const initData = new Uint8Array([0x88, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x2f, 0x00, 0x2f, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00]);strictEqual(extractContentId(initData.buffer), '1234');
Extracts the content ID from InitData using skd:// URI or query parameters.