Skip to content

Commit f692638

Browse files
committed
add drop down box in order to set video quality.
1 parent 820b283 commit f692638

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

samples/dash-if-reference-player/app/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
207207
$scope.jumpGapsSelected = true;
208208
$scope.fastSwitchSelected = true;
209209
$scope.videoAutoSwitchSelected = true;
210+
$scope.videoQualities = [];
210211
$scope.ABRStrategy = 'abrDynamic';
211212

212213
// Persistent license
@@ -340,6 +341,7 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
340341
$scope.player.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, function (e) { /* jshint ignore:line */
341342
stopMetricsInterval();
342343

344+
$scope.videoQualities = $scope.player.getBitrateInfoListFor('video');
343345
$scope.chartCount = 0;
344346
$scope.metricsTimer = setInterval(function () {
345347
updateMetrics('video');
@@ -435,6 +437,10 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
435437
$scope.optionsGutter = bool;
436438
};
437439

440+
$scope.selectVideoQuality = function (quality) {
441+
$scope.player.setQualityFor('video', quality);
442+
}
443+
438444
$scope.doLoad = function () {
439445
$scope.initSession();
440446

samples/dash-if-reference-player/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@
133133
<div class="options-item">
134134
<div class="options-item-title">Playback</div>
135135
<div class="options-item-body">
136+
<label class="options-label">Playback Video quality:
137+
<div class="dropdown" data-toggle="tooltip" data-placement="left"
138+
title="Please select your video quality">
139+
<button class="btn btn-primary dropdown-toggle" type="button" id="menu1" data-toggle="dropdown">Set Video Quality
140+
<span class="caret"></span>
141+
</button>
142+
<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
143+
<li ng-repeat="bitrateInfo in videoQualities"><a ng-click="selectVideoQuality(bitrateInfo.qualityIndex)">{{bitrateInfo.qualityIndex + 1}}</a></li>
144+
</ul>
145+
</div>
146+
</label>
136147
<label class="topcoat-checkbox" data-toggle="tooltip" data-placement="right"
137148
title="Enables automatic startup of the media once the media is loaded">
138149
<input type="checkbox" ng-model="autoPlaySelected" ng-change="toggleAutoPlay()" ng-checked="autoPlaySelected">

0 commit comments

Comments
 (0)