Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setProtectionData is ignored if MPD has multiple DRM systems #4649

Open
JaroslavHerber opened this issue Dec 12, 2024 · 3 comments
Open

setProtectionData is ignored if MPD has multiple DRM systems #4649

JaroslavHerber opened this issue Dec 12, 2024 · 3 comments
Labels

Comments

@JaroslavHerber
Copy link

I have a MPD file with this ContentProtection tags:

<ContentProtection schemeIdUri="urn:uuid:EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED">
	<cenc:pssh xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dashif="https://dashif.org/" xmlns:ns4="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2014:xml+bin" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">AAA...==</cenc:pssh>
</ContentProtection>
<ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0">
	<cenc:pssh xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dashif="https://dashif.org/" xmlns:ns4="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2014:xml+bin" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">A...AA==</cenc:pssh>
</ContentProtection>
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="57e48b99-f3f6-d4f1-3f5c-5afdcca084ca" xmlns:cenc="urn:mpeg:cenc:2013"/>

And because I have offline clearkey strings, I want to use them like this:

var oAvPlayer = document.getElementById("player");
var oDashApi = dashjs.MediaPlayer().create();
oDashApi.initialize();
oDashApi.setProtectionData({
	"org.w3.clearkey": {
		"clearkeys": {'KTeaXi00BfrS9dnL6SWGww': 'V+SLmfP21PE/XFr9zKCEyg'},
		"priority": 0
	}
});
oDashApi.attachView(oAvPlayer);
oDashApi.attachSource("https://....mpd");

But somehow setProtectionData (and priority) is ignored and instead PlayReady is selected:
[1335658][ProtectionController] DRM: KeySystem Access Granted for system string (com.microsoft.playready)! Selecting key system...

This happens with latest stable (4.2.0) and master (5.0.0)
Any idea?

If I call this:
oDashApi.getProtectionController().getKeySystems();
.. the first item is always: "com.microsoft.playready"

@dsilhavy
Copy link
Collaborator

I have not seen a test content with a commercial DRM like Widevine/Playready and Clearkey at the same time. It looks like Clearkey is not signaled in your MPD but only Widevine and Playready. Try adding Clearkey signaling to the MPD:

<ContentProtection value="ClearKey1.0" schemeIdUri="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"></ContentProtection>

@JaroslavHerber
Copy link
Author

Sadly I cannot edit the MPD file. This comes from a playlist provider. In fact I see a lot of playlist providers offer such channels.

ClearKey seems to be a DRM system with a lot of variations. I saw a bunch of selection mechanics - ExoPlayer/Media3 for example checks if there is a attribute "cenc:default_KID" inside a ContentProtection tag and maps this one as clearkey system.
Are you planning on adding such alternative selection mechanics?

@dsilhavy
Copy link
Collaborator

Sadly I cannot edit the MPD file. This comes from a playlist provider. In fact I see a lot of playlist providers offer such channels.

ClearKey seems to be a DRM system with a lot of variations. I saw a bunch of selection mechanics - ExoPlayer/Media3 for example checks if there is a attribute "cenc:default_KID" inside a ContentProtection tag and maps this one as clearkey system. Are you planning on adding such alternative selection mechanics?

What I don't really understand is why a provider would encrypt the content for usage with a "real" commercial DRM (Widevine, Playready) and then make the key transparent using Clearkey. Clearkey is not a real DRM system. It offers some very basic security, but the key is visible. This is not the case for commercial DRM systems like Widevine or Playready. Commercial providers such as Netflix etc will never use Clearkey to protect their content.

That being said, what you can use as a workaround is the network interceptor that we introduced with dash.js v5: https://reference.dashif.org/dash.js/nightly/samples/network-interceptor/index.html. It allows you to modify the payload of a request prior to dash.js using it. That way you can add missing information to the MPD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants