Skip to content

Commit

Permalink
Even noisier debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Satsuoni committed Aug 4, 2021
1 parent c8fb9ca commit 6496c88
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions eme_interception.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ EmeInterception.prototype.addListenersToNavigator_ = function()
navigator.mediaCapabilities.decodingInfo = function()
{
var self = arguments[0];
//console.log(arguments);
console.log(arguments);
// slice "It is recommended that a robustness level be specified" warning
var modifiedArguments = arguments;
//var modifiedOptions = EmeInterception.addRobustnessLevelIfNeeded(options);
//modifiedArguments[1] = modifiedOptions;
var modifiedOptions = EmeInterception.addRobustnessLevelIfNeededForDecodingInfo(arguments);
modifiedArguments = modifiedOptions;

var result = originalDecodingInfoFn.apply(null, modifiedArguments);
// Attach listeners to returned MediaKeySystemAccess object
Expand Down Expand Up @@ -442,7 +442,34 @@ EmeInterception.interceptEvent = function(type, event)
EmeInterception.onOperation(type, event,null);
return event;
};

EmeInterception.addRobustnessLevelIfNeededForDecodingInfo = function(options)
{
for (var i = 0; i < options.length; i++)
{
var option = options[i];
if(!option.keySystemConfiguration) continue;
var video = option.keySystemConfiguration["video"];
var audio = option.keySystemConfiguration["audio"];
if (video != null)
{
if (video["robustness"]==undefined || !video["robustness"].length ||video["robustness"].length ==0)
{
video["robustness"]="SW_SECURE_CRYPTO";
}
}
if (audio != null)
{
if (audio["robustness"]==undefined || !audio["robustness"].length ||audio["robustness"].length ==0)
{
audio["robustness"]="SW_SECURE_CRYPTO";
}
}
option.keySystemConfiguration.video=video;
option.keySystemConfiguration.audio=audio;
options[i]=option;
}
return options;
}
EmeInterception.addRobustnessLevelIfNeeded = function(options)
{
for (var i = 0; i < options.length; i++)
Expand Down

0 comments on commit 6496c88

Please sign in to comment.