@svta/common-media-library
Version:
A common library for media playback in JavaScript
23 lines • 792 B
JavaScript
import { parsePsshList } from './parsePsshList.js';
/**
* Returns the PSSH box associated with the given key system from the concatenated
* list of PSSH boxes in the provided initData.
*
* @param uuid - The desired key system UUID
* @param initData - 'cenc' initialization data. Concatenated list of PSSH boxes.
* @returns The PSSH box ArrayBuffer corresponding to the given key system, or null if not found.
*
* @group DRM
* @beta
*
* @example
* {@includeCode ../../../test/drm/cenc/getPsshForKeySystem.test.ts#example}
*/
export function getPsshForKeySystem(uuid, initData) {
if (!initData || !uuid) {
return null;
}
const psshList = parsePsshList(initData);
return psshList[uuid.toLowerCase()] || null;
}
//# sourceMappingURL=getPsshForKeySystem.js.map