Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ABR controller if min allowed bitrate is set #3002

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion samples/dash-if-reference-player/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,30 @@ app.controller('DashController', function ($scope, sources, contributors, dashif

const initBitrate = parseInt($scope.initialVideoBitrate);
if (!isNaN(initBitrate)) {
config.abr = {
config.streaming.abr = {
'initialBitrate': {
'video': initBitrate
}
}
}

const minBitrate = parseInt($scope.minVideoBitrate);
if (!isNaN(minBitrate)) {
config.streaming.abr = {
'minBitrate': {
'video': minBitrate
}
}
}

const maxBitrate = parseInt($scope.maxVideoBitrate);
if (!isNaN(maxBitrate)) {
config.streaming.abr = {
'maxBitrate': {
'video': maxBitrate
}
}
}
$scope.player.updateSettings(config);

$scope.controlbar.reset();
Expand Down
4 changes: 4 additions & 0 deletions samples/dash-if-reference-player/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@
<div class="options-item-body">
<label class="options-label">Initial bitrate Video:</label>
<input type="text" class="form-control" placeholder="value in kbps" ng-model="initialVideoBitrate">
<label class="options-label">Minimum bitrate Video:</label>
<input type="text" class="form-control" placeholder="value in kbps" ng-model="minVideoBitrate">
<label class="options-label">Maximum bitrate Video:</label>
<input type="text" class="form-control" placeholder="value in kbps" ng-model="maxVideoBitrate">
<label class="options-label">Audio:</label>
<input type="text" class="form-control" placeholder="audio initial lang, e.g. 'en'" ng-model="initialSettings.audio">
<label class="options-label">Video:</label>
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/controllers/AbrController.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function AbrController() {
const topQualityIdx = getTopQualityIndexFor(type, streamId);
const switchRequest = abrRulesCollection.getMaxQuality(rulesContext);
let newQuality = switchRequest.quality;
if (minIdx !== undefined && newQuality < minIdx) {
if (minIdx !== undefined && ((newQuality > SwitchRequest.NO_CHANGE) ? newQuality : oldQuality) < minIdx) {
newQuality = minIdx;
}
if (newQuality > topQualityIdx) {
Expand Down