videojs-contrib-dash icon indicating copy to clipboard operation
videojs-contrib-dash copied to clipboard

How to set robustness level

Open tundratier opened this issue 7 years ago • 3 comments

How can I set the EME robustness level?

You can set it with mediaPlayer.getProtectionController().setRobustnessLevel('SW_SECURE_CRYPTO');

But I can't find the right place to call this method. I've tried the beforeinitialize and updatesource hooks. Both do not work.

tundratier avatar Jan 17 '18 11:01 tundratier

wondering the same thing. Is this documented anywhere?

ralyodio avatar Dec 20 '18 06:12 ralyodio

Also wondering the same thing I am getting lots of errors in Chrome but its working in Firefox.

screenshot 2019-01-10 at 16 28 34

samueleastdev avatar Jan 10 '19 16:01 samueleastdev

I tested that it works with the beforeinitialize hook, and it does. If you find your code is not working, please put it on a codepen so that we can review it for any potential errors.

Here is an example of what you'd do:

var dashSetup = function(player, mediaPlayer) {
  mediaPlayer.getProtectionController().setRobustnessLevel('SW_SECURE_CRYPTO');
};

var player = videojs('player');
videojs.Html5DashJS.hook('beforeinitialize', dashSetup);

squarebracket avatar Feb 24 '19 20:02 squarebracket