This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Similar to how a license format [1] has been documented for bug 17682, we should document the license request format. For Clear Key, the message attribute of the needkey event is currently defined as "a container-specific value extracted from the initData parameter of createSession()." Instead of defining a format for each container and requiring applications/servers to support different formats for each container, we should define a license request format. Defining a JSON-based format would be consistent with the license format [1]. This also has the advantage of not passing a binary blob to the application as would happen in the CENC case (bug 24027). [1] https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#simple-decryption-clear-key
Since the MediaKeyMessageEvent defines the message as a Uint8Array, which I think is needed for some CDMs, how would you overload this to pass a JSON license request?
(In reply to Adrian Bateman [MSFT] from comment #1) > Since the MediaKeyMessageEvent defines the message as a Uint8Array, which I > think is needed for some CDMs, how would you overload this to pass a JSON > license request? The JSON would need to be base64url encoded like the license format.
For the format, I propose non-JWK[S] JSON with the key IDs encoded in base64url This has the advantages of being: * mostly consistent with the license format (JSON and base64url key IDs, though not JWK[S]) * parsable by JavaScript * extensible (vs. a simple array of key IDs) Here's an example: { "kids": [ "67ef0gd8pvfd0=", "77ef0gd8pvfd0=" ] } (In reply to David Dorwin from comment #2) > (In reply to Adrian Bateman [MSFT] from comment #1) > > Since the MediaKeyMessageEvent defines the message as a Uint8Array, which I > > think is needed for some CDMs, how would you overload this to pass a JSON > > license request? > > The JSON would need to be base64url encoded like the license format. Ignore the above reply. We should use the Encoding API: http://www.w3.org/TR/encoding/
As with JWK, padding is omitted. Here's a fixed example: { "kids": [ "67ef0gd8pvfd0", "77ef0gd8pvfd0" ] }
Implemented in https://dvcs.w3.org/hg/html-media/rev/9e6c5040c5f4