From 5cf1d87a6746f1cdf8297a612929aeeb626a84ed Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 22 Oct 2024 17:16:51 +0200 Subject: [PATCH] Returned PSSH Box instead of PSSH Data --- license.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/license.js b/license.js index ad72cd4..6935d6f 100644 --- a/license.js +++ b/license.js @@ -366,6 +366,16 @@ export class Session { } getPSSH() { - return uint8ArrayToBase64(this._pssh); + const dataLength = this._pssh.length; + const totalLength = dataLength + 32; + const pssh = new Uint8Array([ + ...this._intToUint8Array(totalLength), + ...PSSH_MAGIC, + ...new Uint8Array(4), + ...WIDEVINE_SYSTEM_ID, + ...this._intToUint8Array(dataLength), + ...this._pssh + ]); + return uint8ArrayToBase64(pssh); } }