diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c3d355cb3b..aa15ac0c4c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -24,6 +24,7 @@ Andy Hochhaus Chad Assareh +Chris Fillmore Costel Madalin Grecu Donato Borrello Duc Pham diff --git a/lib/media/drm_engine.js b/lib/media/drm_engine.js index e653406efb..f1cea0c0e2 100644 --- a/lib/media/drm_engine.js +++ b/lib/media/drm_engine.js @@ -1106,9 +1106,19 @@ shaka.media.DrmEngine.prototype.sendLicenseRequest_ = function(event) { * @private */ shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_ = function(request) { - // The PlayReady license message as it comes from the CDM can't be directly - // delivered to a license server. Other CDMs do not seem to need this kind - // of special handling. + // PlayReady CDMs in some clients (e.g. IE11, Edge) wrap the license message + // in UTF-16 encoded XML which can't be directly delivered to a license + // server. However, not all clients exhibit this behaviour. The Tizen + // 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, new Uint8Array(request.body)); + + if (xml.indexOf(' // - var xml = shaka.util.StringUtils.fromUTF16( + xml = shaka.util.StringUtils.fromUTF16( request.body, true /* littleEndian */); var dom = new DOMParser().parseFromString(xml, 'application/xml');