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

Added new set of test streams from Axinom #3803

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashjs",
"version": "4.1.1",
"version": "4.2.1",
"description": "A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.",
"author": "Dash Industry Forum",
"license": "BSD-3-Clause",
Expand Down
14 changes: 10 additions & 4 deletions samples/advanced/monitoring.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@
var repSwitch = dashMetrics.getCurrentRepresentationSwitch('video', true);
var bufferLevel = dashMetrics.getCurrentBufferLevel('video', true);
var bitrate = repSwitch ? Math.round(dashAdapter.getBandwidthForRepresentation(repSwitch.to, periodIdx) / 1000) : NaN;
var adaptation = dashAdapter.getAdaptationForType(periodIdx, 'video', streamInfo)
var frameRate = adaptation.Representation_asArray.find(function (rep) {
var adaptation = dashAdapter.getAdaptationForType(periodIdx, 'video', streamInfo);
var currentRep = adaptation.Representation_asArray.find(function (rep) {
return rep.id === repSwitch.to
}).frameRate;
})
var frameRate = currentRep.frameRate;
var resolution = currentRep.width + 'x' + currentRep.height;
document.getElementById('bufferLevel').innerText = bufferLevel + " secs";
document.getElementById('framerate').innerText = frameRate + " fps";
document.getElementById('reportedBitrate').innerText = bitrate + " Kbps";
document.getElementById('resolution').innerText = resolution;
}
}, 1000);

Expand Down Expand Up @@ -113,7 +116,10 @@ <h4>Metrics</h4>
<span id="calculatedBitrate"></span>
</div>
<strong>Framerate:</strong>
<span id="framerate"></span>
<span id="framerate"></span>
</br>
<strong>Resolution:</strong>
<span id="resolution"></span>
</div>
</div>
</div>
Expand Down
170 changes: 86 additions & 84 deletions samples/dash-if-reference-player/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,46 +302,6 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
// store a ref in window.player to provide an easy way to play with dash.js API
window.player = $scope.player = dashjs.MediaPlayer().create(); /* jshint ignore:line */

////////////////////////////////////////
//
// Configuration file
//
////////////////////////////////////////
let reqConfig = new XMLHttpRequest();
reqConfig.onload = function () {
if (reqConfig.status === 200) {
let config = JSON.parse(reqConfig.responseText);
if ($scope.player) {
$scope.player.updateSettings(config);
}
} else {
// Set default initial configuration
var initialConfig = {
'debug': {
'logLevel': dashjs.Debug.LOG_LEVEL_INFO
},
'streaming': {
'buffer': {
'fastSwitchEnabled': $scope.fastSwitchSelected,
},
'jumpGaps': true,
'abr': {
'autoSwitchBitrate': {
'video': $scope.videoAutoSwitchSelected
}
}
}
};
$scope.player.updateSettings(initialConfig);
}
setLatencyAttributes();
setAbrRules();
};

reqConfig.open('GET', 'dashjs_config.json', true);
reqConfig.setRequestHeader('Content-type', 'application/json');
reqConfig.send();

$scope.player.on(dashjs.MediaPlayer.events.ERROR, function (e) { /* jshint ignore:line */
console.log(e);
if (!e.event) {
Expand Down Expand Up @@ -1556,69 +1516,111 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
$scope.additionalAbrRules.abandonRequestsRule = currentConfig.streaming.abr.additionalAbrRules.abandonRequestsRule;
}

function getUrlVars() {
var vars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
vars[key] = value;
});
return vars;
}


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

function getUrlVars() {
var vars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
vars[key] = value;
});
return vars;
}
////////////////////////////////////////
//
// Configuration file
//
////////////////////////////////////////
let reqConfig = new XMLHttpRequest();
reqConfig.onload = function () {
if (reqConfig.status === 200) {
let config = JSON.parse(reqConfig.responseText);
if ($scope.player) {
$scope.player.updateSettings(config);
}
} else {
// Set default initial configuration
var initialConfig = {
'debug': {
'logLevel': dashjs.Debug.LOG_LEVEL_INFO
},
'streaming': {
'buffer': {
'fastSwitchEnabled': $scope.fastSwitchSelected,
},
'jumpGaps': true,
'abr': {
'autoSwitchBitrate': {
'video': $scope.videoAutoSwitchSelected
}
}
}
};
$scope.player.updateSettings(initialConfig);
}
setLatencyAttributes();
setAbrRules();

checkLocationProtocol();

var vars = getUrlVars();
var item = {};
checkLocationProtocol();

if (vars && vars.hasOwnProperty('url')) {
item.url = vars.url;
}
var vars = getUrlVars();
var item = {};

if (vars && vars.hasOwnProperty('mpd')) {
item.url = vars.mpd;
}
if (vars && vars.hasOwnProperty('url')) {
item.url = vars.url;
}

if (vars && vars.hasOwnProperty('source')) {
item.url = vars.source;
}
if (vars && vars.hasOwnProperty('mpd')) {
item.url = vars.mpd;
}

if (vars && vars.hasOwnProperty('stream')) {
try {
item = JSON.parse(atob(vars.stream));
} catch (e) {
if (vars && vars.hasOwnProperty('source')) {
item.url = vars.source;
}

if (vars && vars.hasOwnProperty('stream')) {
try {
item = JSON.parse(atob(vars.stream));
} catch (e) {
}
}
}


if (vars && vars.hasOwnProperty('targetLatency')) {
let targetLatency = parseInt(vars.targetLatency, 10);
if (!isNaN(targetLatency)) {
item.bufferConfig = {
lowLatencyMode: true,
liveDelay: targetLatency / 1000
};
if (vars && vars.hasOwnProperty('targetLatency')) {
let targetLatency = parseInt(vars.targetLatency, 10);
if (!isNaN(targetLatency)) {
item.bufferConfig = {
lowLatencyMode: true,
liveDelay: targetLatency / 1000
};

$scope.lowLatencyModeSelected = true;
$scope.lowLatencyModeSelected = true;
}
}
}

if (item.url) {
var startPlayback = false;
if (item.url) {
var startPlayback = false;

$scope.selectedItem = item;
$scope.selectedItem = item;

if (vars.hasOwnProperty('autoplay')) {
startPlayback = (vars.autoplay === 'true');
}
if (vars.hasOwnProperty('autoplay')) {
startPlayback = (vars.autoplay === 'true');
}

if (startPlayback) {
$scope.doLoad();
if (startPlayback) {
$scope.doLoad();
}
}
}
};

reqConfig.open('GET', 'dashjs_config.json', true);
reqConfig.setRequestHeader('Content-type', 'application/json');
reqConfig.send();

$scope.initChartingByMediaType('video');
$scope.initChartingByMediaType('audio');
})();

////////////////////////////////////////
Expand Down
Loading