Skip to content

Commit

Permalink
Add option to mute playback in reference UI via query parameters (#4196)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed May 31, 2023
1 parent 8c3675a commit f18da5a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions samples/dash-if-reference-player/app/main.js
Expand Up @@ -241,6 +241,8 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
mpd: encodeURIComponent('https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd'),
loop: true,
autoPlay: true,
autoLoad: false,
muted: false,
drmToday: false,
forceQualitySwitchSelected: false,
drmPrioritiesEnabled: false,
Expand Down Expand Up @@ -291,6 +293,7 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
// Starting Options
$scope.autoPlaySelected = true;
$scope.autoLoadSelected = false;
$scope.muted = false;
$scope.cmcdEnabled = false;
$scope.cmsdEnabled = false;
$scope.cmsdApplyMb = false;
Expand Down Expand Up @@ -498,6 +501,10 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
$scope.player.setAutoPlay($scope.autoPlaySelected);
};

$scope.toggleMuted = function () {
$scope.player.setMute($scope.muted)
}

$scope.changeFetchThroughputCalculation = function (mode) {
$scope.player.updateSettings({
streaming: {
Expand Down Expand Up @@ -1497,6 +1504,7 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
loop: $scope.loopSelected,
autoPlay: $scope.autoPlaySelected,
autoLoad: $scope.autoLoadSelected,
muted: $scope.muted,
drmToday: $scope.drmToday,
forceQualitySwitchSelected: $scope.forceQualitySwitchSelected,
drmPrioritiesEnabled: $scope.prioritiesEnabled,
Expand Down Expand Up @@ -1766,6 +1774,10 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
case 'autoLoad':
$scope.autoLoadSelected = this.parseBoolean(value);
break;
case 'muted':
$scope.muted = this.parseBoolean(value);
$scope.toggleMuted();
break;
case 'drmToday':
$scope.drmToday = this.parseBoolean(value);
break;
Expand Down
6 changes: 6 additions & 0 deletions samples/dash-if-reference-player/index.html
Expand Up @@ -157,6 +157,12 @@
ng-checked="autoPlaySelected">
Auto-Play
</label>
<label class="topcoat-checkbox" data-toggle="tooltip" data-placement="right"
title="Sets the muted attribute on the video element">
<input type="checkbox" ng-model="muted" ng-change="toggleMute()"
ng-checked="muted">
Muted
</label>
<label class="topcoat-checkbox" data-toggle="tooltip" data-placement="right"
title="Enables looping of the media once playback has completed">
<input type="checkbox" id="loop-cb" ng-model="loopSelected" ng-checked="loopSelected">
Expand Down

0 comments on commit f18da5a

Please sign in to comment.