-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Check if PlayReady license message is wrapped in XML. #815
Check if PlayReady license message is wrapped in XML. #815
Conversation
message is wrapped in XML.
message is wrapped in XML.
lib/media/drm_engine.js
Outdated
// PlayReady CDM message is UTF-8 encoded and can be passed to the license | ||
// server as-is. Other CDMs do not seem to need this kind of special | ||
// handling. | ||
var xml = String.fromCharCode.apply(null, request.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.body is typed as an ArrayBuffer, so you will need to wrap that in "new Uint8Array".
Here's a demo of fromCharCode applied to both a Uint8Array and an ArrayBuffer:
u = new Uint8Array([61, 62, 63, 64, 65]);
String.fromCharCode.apply(null, u);
"=>?@A"
String.fromCharCode.apply(null, u.buffer);
""
If request.body is a Uint8Array at runtime, wrapping it again will not cause a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Thank you very much for your contribution! |
an ArrayBuffer.
…b.com/chrisfillmore/shaka-player into feature/tizenSupport_playreadyMessage
Looks good to me! I'll run tests on the build bot. |
All tests passed! |
This fix was just released in v2.1.2. |
Resolves #814