-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
WebkitAddKey argument mismatch while playing EME v0.1b widevine stream #2149
Comments
It looks like the initData needs to be wrapped in a I don't know if there are implementations which rely on this broken behavior. |
According to EME specification (https://w3c.github.io/encrypted-media/#mediakeysession-interface) update method of MediaKeySession should receive an argument whose type should be BufferSource. This is, ArrayBuffer or any TypedArray (Int8Array, Uint8Array, etc..). So this seems to be fine with dash.js implementation and the reason behind this didn't raise any error until now. However, in the practice, I guess there are browser/devices implementations that require the key So, to guarantee compatibility across different devices I think make sense modifying dash.js to ensure key type is Uint8Array. This will work with everything: I right tested both scenarios, ArrayBuffer and Uint8Array, in Chrome. |
Sorry, right notice I was wrong. Browser that raised this issue is using ProtectionModel_01b so it uses addKey method (first version of EME spec) and it always requires the key to be passed as an Uint8Array. Line
new Uint8Array(message), new Uint8Array(sessionToken.initData), sessionID);
|
Presumably the ClearKey branch of the surrounding |
yep, you are right. @pavankn, given you have a quick way of reproducing the issue, would it be possible for you to check if above recommendation fix your problem? |
Hi @epiclabsDASH and @bbcrddave , videoElement[api.addKey](keySystem.systemString, new Uint8Array(message), new Uint8Array(sessionToken.initData), sessionID); I will update the bug again after testing the ClearKey branch of the surrounding if . The 3rd argument in the case of clearkey is message.keyPairs[i].keyID which seems to me like a Uint8Array itself but i will test and update Thanks |
Great, many thanks for the feedback |
Hi @pavankn, Do you have any info to share regarding ClearKey and the surrounding if? Thanks! |
Hi, Pavan |
Perfect. I will send a PR with the modification that works for the non ClearKey branch of the if. Thanks for your help. |
Closing this one. @pavankn, thanks for your support. |
Thanks @epiclabsDASH . Pavan |
Fix #2149 - webkitAddKey argument mistmatch
Hi ,
I am Trying to load the stream below and getting an error from Dash reference player v2.5.0 .
Stream : https://storage.googleapis.com/shaka-demo-assets/sintel-widevine/dash.mpd
DRM KeySystem : com.widevine.alpha
License Server : https://widevine-proxy.appspot.com/proxy
Platform :
Browser : WPEWebKit master branch
Hardware : ARM based SOC
EME : EME v0.1b (prefixed EME)
The Error is as follows :
dash.all.debug.js:40688:37: CONSOLE ERROR TypeError: Argument 3 ('initData') to HTMLMediaElement.webkitAddKey must be an instance of Uint8Array .
The Call that resulted in the error is as follows :
videoElement[api.addKey](keySystem.systemString, new Uint8Array(message), sessionToken.initData, sessionID);
here sessionToken.initData is an ArrayBuffer and not UInt8Array which is causing the issue .
I would like to know if there is a fix for this already .
The text was updated successfully, but these errors were encountered: