Skip to content

Commit

Permalink
Set latency attributes in reference client after the default json has…
Browse files Browse the repository at this point in the history
… been loaded (#3301)
  • Loading branch information
dsilhavy committed Jun 18, 2020
1 parent a700684 commit d2c6b78
Showing 1 changed file with 13 additions and 9 deletions.
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

0 comments on commit d2c6b78

Please sign in to comment.