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

Set latency attributes in reference client after the default json has… #3301

Merged
merged 1 commit into from Jun 18, 2020
Merged
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
22 changes: 13 additions & 9 deletions samples/dash-if-reference-player/app/main.js
Expand Up @@ -240,6 +240,7 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
let config = JSON.parse(reqConfig.responseText);
if ($scope.player) {
$scope.player.updateSettings(config);
setLatencyAttributes();
}
} else {
// Set default initial configuration
Expand All @@ -256,8 +257,9 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
}
}
}
}
};
$scope.player.updateSettings(initialConfig);
setLatencyAttributes();
}
};

Expand Down Expand Up @@ -316,14 +318,6 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
$scope.player.attachTTMLRenderingDiv($('#video-caption')[0]);
}

// get buffer default value
var currentConfig = $scope.player.getSettings();
$scope.defaultLiveDelay = currentConfig.streaming.liveDelay;
$scope.defaultStableBufferDelay = currentConfig.streaming.stableBufferTime;
$scope.defaultBufferTimeAtTopQuality = currentConfig.streaming.bufferTimeAtTopQuality;
$scope.defaultBufferTimeAtTopQualityLongForm = currentConfig.streaming.bufferTimeAtTopQualityLongForm;
$scope.lowLatencyModeSelected = currentConfig.streaming.lowLatencyEnabled;

var initVideoTrackSwitchMode = $scope.player.getTrackSwitchModeFor('video');
var initAudioTrackSwitchMode = $scope.player.getTrackSwitchModeFor('audio');

Expand Down Expand Up @@ -934,6 +928,16 @@ app.controller('DashController', function ($scope, sources, contributors, dashif
}
}

function setLatencyAttributes() {
// get buffer default value
var currentConfig = $scope.player.getSettings();
$scope.defaultLiveDelay = currentConfig.streaming.liveDelay;
$scope.defaultStableBufferDelay = currentConfig.streaming.stableBufferTime;
$scope.defaultBufferTimeAtTopQuality = currentConfig.streaming.bufferTimeAtTopQuality;
$scope.defaultBufferTimeAtTopQualityLongForm = currentConfig.streaming.bufferTimeAtTopQualityLongForm;
$scope.lowLatencyModeSelected = currentConfig.streaming.lowLatencyEnabled;
}


(function init() {
$scope.initChartingByMediaType('video');
Expand Down