Skip to content

Commit

Permalink
Bugfix/settings url (#3885)
Browse files Browse the repository at this point in the history
* Fixed DRM priorities not being correctly reflected in View

* Fixed multiple clearkeys not updating in view, Fixed 'no settings parameter d' error when having only an mpd in the query-string

* Fixed Clearkey setting overwriting Widevine, removed console.log

Co-authored-by: ShikiSeiren <[email protected]>
  • Loading branch information
dsilhavy and ShikiSeiren authored Feb 23, 2022
1 parent 76fa1c2 commit 55a2d99
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
35 changes: 21 additions & 14 deletions samples/dash-if-reference-player/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'

$scope.player.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, function (e) { /* jshint ignore:line */
stopMetricsInterval();

$scope.videoQualities = $scope.player.getBitrateInfoListFor('video');
$scope.chartCount = 0;
$scope.metricsTimer = setInterval(function () {
Expand Down Expand Up @@ -1058,10 +1057,6 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
$scope.drmKeySystem = item;
};

$scope.doLog = function () {
console.log($scope.drmPlayready.priority);
}

/** Handle form input */
$scope.setDrm = function () {

Expand Down Expand Up @@ -1295,6 +1290,10 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
case 'org.w3.clearkey':
// Set DRM to active
$scope.drmClearkey.isActive = true;
//TODO : Check if any examples are not kid=key method!
if(!protectionData[data].hasOwnProperty('inputMode')){
protectionData[data]['inputMode'] = 'kidKey';
}
$scope.drmClearkey.inputMode = protectionData[data]['inputMode'];
// Handle clearkey data if specified using a license server
if (protectionData[data]['serverURL'] !== undefined) {
Expand Down Expand Up @@ -1333,7 +1332,7 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
if (parameter !== 'serverURL' &&
parameter !== 'httpRequestHeaders' &&
parameter !== 'clearkeys') {
$scope.drmWidevine[parameter] = protectionData[data][parameter];
$scope.drmClearkey[parameter] = protectionData[data][parameter];
}
}
break;
Expand Down Expand Up @@ -1520,8 +1519,10 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'

}
}
prioritiesEnabled = settingsObject.prioritiesEnabled;
drmObject = $scope.makeProtectionData(drmObject, prioritiesEnabled);
prioritiesEnabled = settingsObject.drmPrioritiesEnabled;
if(prioritiesEnabled !== undefined){
drmObject = $scope.makeProtectionData(drmObject, prioritiesEnabled);
}
return [settingsObject, drmObject];
}

Expand Down Expand Up @@ -1663,11 +1664,10 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
}

$scope.setQueryData = function(currentQuery){
// var delimiter = '&',
// start = 10,
// tokens = currentQuery.split(delimiter).slice(start),
// currentQuery = tokens.join(delimiter);
var passedSettings = currentQuery.slice(currentQuery.indexOf('debug'));;
if(!currentQuery.includes('&')){
return;
}
var passedSettings = currentQuery.slice(currentQuery.indexOf('debug'));
passedSettings = $scope.toSettingsObject(passedSettings)[0];
$scope.protectionData = $scope.toSettingsObject(currentQuery)[1];
$scope.player.updateSettings(passedSettings);
Expand Down Expand Up @@ -1967,6 +1967,13 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
$scope.customABRRulesSelected = !currentConfig.streaming.abr.useDefaultABRRules;
}

function setDrmOptions(){
var currentConfig = $scope.player.getSettings();
$scope.drmPlayready.priority = $scope.drmPlayready.priority.toString();
$scope.drmWidevine.priority = $scope.drmWidevine.priority.toString();
$scope.drmClearkey.priority = $scope.drmClearkey.priority.toString();
}

function setLiveDelayOptions(){
var currentConfig = $scope.player.getSettings();
$scope.initialLiveDelay = currentConfig.streaming.delay.liveDelay;
Expand Down Expand Up @@ -2110,13 +2117,13 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
setAbrRules();
setAdditionalPlaybackOptions();
setAdditionalAbrOptions();
setDrmOptions();
setLiveDelayOptions();
setInitialSettings();
setTrackSwitchModeSettings();
setInitialLogLevel();
setCMCDSettings();


checkLocationProtocol();

var vars = getUrlVars();
Expand Down
6 changes: 3 additions & 3 deletions samples/dash-if-reference-player/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@

<div ng-show="prioritiesEnabled">
<label class="options-label">Priority</label>
<select name="playreadyPriority" ng-model="drmPlayready.priority"
<select name="playreadyPriority" id="playreadyPriority" ng-model="drmPlayready.priority"
ng-init="drmPlayready.priority='1'">
<option value=0>0</option>
<option value=1>1</option>
Expand Down Expand Up @@ -471,7 +471,7 @@

<div ng-show="prioritiesEnabled">
<label class="options-label">Priority</label>
<select name="widevinePriority" ng-model="drmWidevine.priority"
<select name="widevinePriority" id="widevinePriority" ng-model="drmWidevine.priority"
ng-init="drmWidevine.priority='0'">
<option value=0>0</option>
<option value=1>1</option>
Expand Down Expand Up @@ -588,7 +588,7 @@

<div ng-show="prioritiesEnabled">
<label class="options-label">Priority</label>
<select name="clearkeyPriority" ng-model="drmClearkey.priority"
<select name="clearkeyPriority" id="clearkeyPriority" ng-model="drmClearkey.priority"
ng-init="drmClearkey.priority='2'">
<option value=0>0</option>
<option value=1>1</option>
Expand Down

0 comments on commit 55a2d99

Please sign in to comment.