Skip to content

Instantly share code, notes, and snippets.

@robypez
Created November 23, 2022 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robypez/7c95824459cdd32d2a111b14701e773c to your computer and use it in GitHub Desktop.
Save robypez/7c95824459cdd32d2a111b14701e773c to your computer and use it in GitHub Desktop.
if (this.drm) {
if ($Player.isHbbTv() && -1 === navigator.userAgent.indexOf("SmartTV_2019_1"))
for (var b = g.getProtectionController().getKeySystems(), a = 0; a < b.length; a++)
if ("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" === b[a].schemeIdURI) {
b[a].setPlayReadyMessageFormat("utf-8");
break
} b = "PLAYREADY" === $DEVICE.preferredDRM ? {
"com.microsoft.playready": {
serverURL: this.drm.url
}
} : {
"com.widevine.alpha": {
serverURL: this.drm.url
}
};
"nagra" === this.drm.operator && b["com.microsoft.playready"] && (a = this.drm.url.split("?"), b["com.microsoft.playready"].serverURL = a[0], b["com.microsoft.playready"].httpRequestHeaders = {
"nv-authorizations": a[1].split("=")[1]
});
g.setProtectionData(b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment