-
Notifications
You must be signed in to change notification settings - Fork 133
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
Multiple keys per license implementation #863
Comments
I agree that MKPL license handling in the RxPlayer should remain as reliable and as resilient as possible in the presence of future use cases or new MKPL license delivery schemes. So, how about designing the RxPlayer MKPL mode to be compatible with some kind of "worst case" or "minimal" MKPL license server model ? Let's assume the MKPL license server only guarantees that, for any MKPL license request:
With this model, a simple and resilient implementation of the RxPlayer MKPL mode could go as follows:
Now a simple example. Let's assume we have a decent MKPL license server (that returns all allowed keys for any license request), a content with 3 keys (AU, SD, HD) and a CDM trusted only for AU and SD keys.
So, if the app has the possibility to give a hint to the RxPlayer on the preferred initial video quality (SD vs HD here), it can choose between:
I have the feeling this is not really satisfactory, but that is the simplest and most resilient strategy I can think of right now without the app expressing and transmitting to the RxPlayer some specific and/or complex expectations on the behaviour of the MKPL license server or on the properties of the content itself. |
New thought. On top of the above "minimum assumption" behaviour, the RxPlayer could optionaly pre-fill the extended |
For the first solution, that should work but yes we might perform multiple unnecessary requests for undecipherable profiles. For the "extended |
For now, I see two possible strategies:
|
OK, your option 2 looks promising and quite extensible after all. I would vote for an API allowing to tell directly to the RxPlayer about the expected "scope" of any license e.g. a parameter such as Now about CDM compatibility, I'd like to draw your attention to some embedded CDM implementations (STB) that:
So, we'll probably have to discuss whether this CDM implementation should be modified (e.g. memoize keyId / initdata pairs inside CDM and allocate corresponding decryption channel on-the-fly when fragments with this keyId are pushed ?) or whether the RxPlayer should/could still perform This is food for thought so we don't forget both ends of the problem while trying to figure out a good solution on the player side. |
The RxPlayer already integrated those words in its API (though it is true that I sometimes prefer that the term Also, an RxPlayer's
You mean that in some implementations, a That's not optimal for us, we thought that key-id where inserted in a Here this means that some It is much harder to implement than just having a single |
Yes, that is my understanding from reading the CDM source code (last time I checked). So we'll have to discuss this with the CDM developers. First, they might be reluctant to defer such hardware resources allocation until the license is transmitted to the CDM. Third, I think they currently rely on a native DRM agent API that expects either an opaque PSSH (carrying a single key-id) or a raw key id to perform this hardware decryption channel allocation (retrieving the list of key ids from the received license might not be as straightforward as it sounds, even though such licenses are known to be parseable). Anyway, I agree with you and would also want to avoid creating these unfired |
Closed as #904 has just been merged |
To speed-up the license-fetching process, a proposal to communicate multiple keys in a given license has been made.
This could take the following form: for a given content, a license request linked to any of its key id will return a license containing every keys linked to that content the CDM could be trusted to use (e.g. a widevine L3 might not be trusted handling a license containing a Widevine L1 key, so it would not be contained in it).
For now, the RxPlayer performs a license request every time it encounters new initialization data (typically PSSH boxes) which is principally every time a new key id is encountered. So contents with multiple keys per license (let's call that... MKPL!) work but lead to unnecessary requests.
This issue is here to discuss on what we could do to improve on that.
Doing only a single license request (doable today by doing the request only for the first
getLicense
) works here but I'm afraid of future scenarios where we could still have multiple licenses each containing possibly multiple keys.For example in a multi-Period DASH content, where each Period will have its own MKPL license. We could also imagine that a license might contain keys for every audio tracks but another for every video tracks.
At first, I thought that a general solution could be to perform a single license request at a time, waiting for the result of one to know if it applied to another initialization data (by checking in the
MediaKeyStatusMap
if the key id was present), but this doesn't work due to the fact that a license may not contain some keys on purpose, because the CDM is not trusted.Here we would not know that the license should have contained that key, and still perform a license request when its initialization data is encountered.
If a solution has to be brought here, I become more and more convinced that maybe the particularity of that stream could be explicitely communicated to the RxPlayer.
For example, an API telling us "a license applies to the whole content" or "each license applies to a single Period" could work.
We could imagine something like:
But then, an explicit API might not be flexible enough for some complicated cases (e.g. video tracks have different licenses but not audio tracks.)
To make it more flexible, we could imagine something like a callback. But it has to be powerful enough to communicate the whole extent a license has, so we can properly treat keys that are not present in it but should have been.
What are your thoughts ?
The text was updated successfully, but these errors were encountered: