• Beta

    Returns the PSSH box associated with the given key system from the concatenated list of PSSH boxes in the provided initData.

    Parameters

    • keySystem: undefined | null | KeySystem

      The desired key system

    • initData: undefined | null | ArrayBuffer

      'cenc' initialization data. Concatenated list of PSSH boxes.

    Returns null | ArrayBuffer

    The PSSH box ArrayBuffer corresponding to the given key system, or null if not found.

    const initData = new Uint8Array(samplePsshBox).buffer;
    const result = getPSSHForKeySystem(keySystem, initData);