widevine help

458 views
Skip to first unread message

bdrk

unread,
Sep 21, 2015, 3:50:15 AM9/21/15
to Shaka Player Users
Hi

I'm attempting to play Widevine-encrypted streams using the test app on Chrome 45 (64 bit).  The app correctly detects the different available video\audio bitrates, and even begins buffering but the stream never starts playing.

I've played around with the code without success as I can't see how to explicitly set the PSSH.  Here's roughly what my source data from our back-end looks like.

var testData = {
   
"mpd": "http://.../manifest.mpd",
   
"keyId": "foo",
   
"licenseUrl" : "http://.../widevine?keyid=foo&customerToken=foo&deviceToken=foo",
   
"pssh": "foo"
};


I don't think the docs are entirely clear, so given the above structure, can someone point me in the right direction?

Thanks!


   

tdr...@google.com

unread,
Sep 21, 2015, 12:34:14 PM9/21/15
to Shaka Player Users
Hi,

You use the InterpretContentProtection callback to set the DRM information, which includes the PSSH override, for example:

var initPlayer() {
  var vs = new shaka.player.DashVideoSource(
      mpdUrlString, interpretContentProtection, null, null);
  player = new shaka.player.Player(vs);
  return player.load(vs);
};

var interpretContentProtection(schemeIdUri, contentProtectionElement) {
  // Widevine:
  if (schemeIdUri.toLowerCase() ==
      'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed') {
    var initData = {
      'initData': EXPLICIT_PSSH,
      'initDataType': 'cenc'
    };
    return [{
      'keySystem': 'com.widevine.alpha',
      'licenseServerUrl': LICENSE_SERVER_URL,
      'initData': initData
    }];
  }
  return null;
};


If you have further issues, please run in uncompiled mode with verbose logging on (e.g, by add ?v to the demo application's URL) or by calling shaka.log.setLevel(shaka.log.Level.V1) in your own application.

bdrk

unread,
Sep 21, 2015, 2:48:03 PM9/21/15
to Shaka Player Users
Thanks but I now get the following error

"Uncaught (in promise) DOMException: Initialization data for CENC is incorrect."

My explicit PSSH value is an 84 character base64 encoded string so I convert it to a uint8array first.  However, looking at the format in the link https://w3c.github.io/encrypted-media/cenc-format.html, it doesn't appear to have the correct header.  I'll check with the back-end developers if the pssh string is encoded unless you can think of another reason (I've previously only ever dealt with PlayReady).

ps I'm using Shaka version 1.5.0 and when I attempt to use with the uncompiled version, it reports that goog and shaka are undefined. 

Joey Parrish

unread,
Oct 5, 2015, 3:20:52 PM10/5/15
to bdrk, Shaka Player Users
When you run in uncompiled mode, you need to call ./build/gendeps.sh (part of ./build/all.sh) to generate the dependency map used by the closure library in that mode.  That will fix the error about "goog" and "shaka" being undefined.

A common mistake with PSSHs is that some people only include the provider-specific data (the "Data" field in the CENC format doc) instead of the complete PSSH box structure.

Please let us know if you have any further issues.

--
You received this message because you are subscribed to the Google Groups "Shaka Player Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shaka-player-us...@googlegroups.com.
To post to this group, send email to shaka-pla...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shaka-player-users/1a16468e-9ab4-43a4-8644-db3bfc312fa3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages