shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.09k stars 1.33k forks source link

Question about ClearKey encryption cross-browser #478

Closed osmestad closed 8 years ago

osmestad commented 8 years ago

Hi,

I am wondering if it would be possible to polyfill ClearKey support for Safari and Edge/IE? (as their EME implementations do not seem to support that.)

It works fine in Chrome and Firefox, but would be great with a solution for all browsers :)

joeyparrish commented 8 years ago

Given that clear key does not have to securely handle keys or decryption, I think it would be technically feasible to decode licenses in JavaScript and decrypt segments using WebCrypto. But you would have to parse the segments in JavaScript and decrypt before they are passed to MediaSource, and that's not how the EME APIs work.

So although you could do clear key in JavaScript, it would be much more effort than it's worth, and I'm not sure it's feasible as a polyfill specifically.

joeyparrish commented 8 years ago

If you want to see clear key in Safari, Edge, and IE, you can file bugs against those browsers. Section 9 of the EME spec states:

All user agents MUST support the common key systems described in this section.

So those browsers are technically not in full compliance with the spec until they support clear key anyway.

osmestad commented 8 years ago

Thank you for your swift reply! Was fearing there wouldn't be a simple solution, otherwise I guess it would have been done by now.

Had a look, for WebKit I am guessing it is this ticket: https://bugs.webkit.org/show_bug.cgi?id=158843 (part of: https://bugs.webkit.org/show_bug.cgi?id=158836 )

For Edge/IE I could not find an issue so I created this one: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8427961/

Worth trying to push the web forward :)

joeyparrish commented 8 years ago

Thanks for the links! I'll keep an eye on those bugs.