refactor: consolidate remote cdm initialization into a helper function
This commit is contained in:
		
							parent
							
								
									9e071365e3
								
							
						
					
					
						commit
						f8712d7726
					
				
							
								
								
									
										261
									
								
								src/inject.js
									
									
									
									
									
								
							
							
						
						
									
										261
									
								
								src/inject.js
									
									
									
									
									
								
							@ -537,27 +537,32 @@ function postDRMTypeAndPssh(type, pssh) {
 | 
				
			|||||||
    window.postMessage({ type: "__PSSH_DATA__", data: pssh }, "*");
 | 
					    window.postMessage({ type: "__PSSH_DATA__", data: pssh }, "*");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function createAndOpenRemoteCDM(type, deviceInfo, pssh) {
 | 
				
			||||||
 | 
					    let cdm;
 | 
				
			||||||
 | 
					    if (type === "Widevine") {
 | 
				
			||||||
 | 
					        const { device_type, system_id, security_level, host, secret, device_name } = deviceInfo;
 | 
				
			||||||
 | 
					        cdm = new remoteWidevineCDM(
 | 
				
			||||||
 | 
					            device_type,
 | 
				
			||||||
 | 
					            system_id,
 | 
				
			||||||
 | 
					            security_level,
 | 
				
			||||||
 | 
					            host,
 | 
				
			||||||
 | 
					            secret,
 | 
				
			||||||
 | 
					            device_name
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        cdm.openSession();
 | 
				
			||||||
 | 
					        cdm.getChallenge(pssh);
 | 
				
			||||||
 | 
					    } else if (type === "PlayReady") {
 | 
				
			||||||
 | 
					        const { security_level, host, secret, device_name } = deviceInfo;
 | 
				
			||||||
 | 
					        cdm = new remotePlayReadyCDM(security_level, host, secret, device_name);
 | 
				
			||||||
 | 
					        cdm.openSession();
 | 
				
			||||||
 | 
					        cdm.getChallenge(pssh);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return cdm;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function ensureRemoteCDM(type, deviceInfo, pssh) {
 | 
					function ensureRemoteCDM(type, deviceInfo, pssh) {
 | 
				
			||||||
    if (!remoteCDM) {
 | 
					    if (!remoteCDM) {
 | 
				
			||||||
        if (type === "Widevine") {
 | 
					        remoteCDM = createAndOpenRemoteCDM(type, deviceInfo, pssh);
 | 
				
			||||||
            const { device_type, system_id, security_level, host, secret, device_name } =
 | 
					 | 
				
			||||||
                deviceInfo;
 | 
					 | 
				
			||||||
            remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                device_type,
 | 
					 | 
				
			||||||
                system_id,
 | 
					 | 
				
			||||||
                security_level,
 | 
					 | 
				
			||||||
                host,
 | 
					 | 
				
			||||||
                secret,
 | 
					 | 
				
			||||||
                device_name
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
            remoteCDM.openSession();
 | 
					 | 
				
			||||||
            remoteCDM.getChallenge(pssh);
 | 
					 | 
				
			||||||
        } else if (type === "PlayReady") {
 | 
					 | 
				
			||||||
            const { security_level, host, secret, device_name } = deviceInfo;
 | 
					 | 
				
			||||||
            remoteCDM = new remotePlayReadyCDM(security_level, host, secret, device_name);
 | 
					 | 
				
			||||||
            remoteCDM.openSession();
 | 
					 | 
				
			||||||
            remoteCDM.getChallenge(pssh);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -589,17 +594,11 @@ MediaKeySession.prototype.generateRequest = function (initDataType, initData) {
 | 
				
			|||||||
                interceptType !== "DISABLED" &&
 | 
					                interceptType !== "DISABLED" &&
 | 
				
			||||||
                !serviceCertFound
 | 
					                !serviceCertFound
 | 
				
			||||||
            ) {
 | 
					            ) {
 | 
				
			||||||
                const { device_type, system_id, security_level, host, secret, device_name } =
 | 
					                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                    widevineDeviceInfo;
 | 
					                    "Widevine",
 | 
				
			||||||
                remoteCDM = new remoteWidevineCDM(
 | 
					                    widevineDeviceInfo,
 | 
				
			||||||
                    device_type,
 | 
					                    foundWidevinePssh
 | 
				
			||||||
                    system_id,
 | 
					 | 
				
			||||||
                    security_level,
 | 
					 | 
				
			||||||
                    host,
 | 
					 | 
				
			||||||
                    secret,
 | 
					 | 
				
			||||||
                    device_name
 | 
					 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                remoteCDM.openSession();
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (
 | 
					            if (
 | 
				
			||||||
                !injectionSuccess &&
 | 
					                !injectionSuccess &&
 | 
				
			||||||
@ -751,36 +750,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (base64Body.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (base64Body.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (base64Body.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (base64Body.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
@ -816,36 +797,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
@ -881,36 +844,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: resource }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
@ -967,36 +912,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (base64Body.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (base64Body.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (base64Body.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (base64Body.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
@ -1032,36 +959,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (base64EncodedBody.startsWith(DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
@ -1097,36 +1006,18 @@ MediaKeySession.prototype.update = function (response) {
 | 
				
			|||||||
                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
					                        window.postMessage({ type: "__LICENSE_URL__", data: this._url }, "*");
 | 
				
			||||||
                        if (!remoteCDM) {
 | 
					                        if (!remoteCDM) {
 | 
				
			||||||
                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.WIDEVINE)) {
 | 
					                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.WIDEVINE)) {
 | 
				
			||||||
                                const {
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    device_type,
 | 
					                                    "Widevine",
 | 
				
			||||||
                                    system_id,
 | 
					                                    widevineDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundWidevinePssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name,
 | 
					 | 
				
			||||||
                                } = widevineDeviceInfo;
 | 
					 | 
				
			||||||
                                remoteCDM = new remoteWidevineCDM(
 | 
					 | 
				
			||||||
                                    device_type,
 | 
					 | 
				
			||||||
                                    system_id,
 | 
					 | 
				
			||||||
                                    security_level,
 | 
					 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundWidevinePssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.PLAYREADY)) {
 | 
					                            if (jsonContainsValue(jsonBody, DRM_SIGNATURES.PLAYREADY)) {
 | 
				
			||||||
                                const { security_level, host, secret, device_name } =
 | 
					                                remoteCDM = createAndOpenRemoteCDM(
 | 
				
			||||||
                                    playreadyDeviceInfo;
 | 
					                                    "PlayReady",
 | 
				
			||||||
                                remoteCDM = new remotePlayReadyCDM(
 | 
					                                    playreadyDeviceInfo,
 | 
				
			||||||
                                    security_level,
 | 
					                                    foundPlayreadyPssh
 | 
				
			||||||
                                    host,
 | 
					 | 
				
			||||||
                                    secret,
 | 
					 | 
				
			||||||
                                    device_name
 | 
					 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
                                remoteCDM.openSession();
 | 
					 | 
				
			||||||
                                remoteCDM.getChallenge(foundPlayreadyPssh);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
					                        if (remoteCDM && remoteCDM.challenge === null) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user