Skip to content

Commit 74de535

Browse files
committed
Add some additional debug outputs in the reference UI
1 parent 612a36e commit 74de535

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

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

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
294294
$scope.audioLiveLatency = 0;
295295
$scope.audioPlaybackRate = 1.00;
296296

297+
$scope.activePeriod = '';
298+
$scope.bufferingPeriod = '';
299+
300+
$scope.mpdType = '';
301+
$scope.numberOfPeriods = 0;
302+
297303
// Starting Options
298304
$scope.autoPlaySelected = true;
299305
$scope.autoLoadSelected = false;
@@ -434,6 +440,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
434440

435441
$scope.player.on(dashjs.MediaPlayer.events.MANIFEST_LOADED, function (e) {
436442
$scope.isDynamic = e.data.type === 'dynamic';
443+
if (e.data.Period) {
444+
$scope.numberOfPeriods = e.data.Period.length;
445+
}
446+
if (e.data.type) {
447+
$scope.mpdType = e.data.type;
448+
}
437449
}, $scope);
438450

439451

@@ -450,11 +462,16 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
450462
$scope[e.mediaType + 'Bitrate'] = bitrate;
451463
$scope.plotPoint('pendingIndex', e.mediaType, e.newQuality + 1, getTimeForPlot());
452464
$scope.safeApply();
465+
466+
if (e.currentRepresentation && e.currentRepresentation.adaptation && e.currentRepresentation.adaptation.period) {
467+
$scope.bufferingPeriod = e.currentRepresentation.adaptation.period.id;
468+
}
453469
}, $scope);
454470

455471

456472
$scope.player.on(dashjs.MediaPlayer.events.PERIOD_SWITCH_COMPLETED, function (e) {
457473
$scope.currentStreamInfo = e.toStreamInfo;
474+
$scope.activePeriod = e.toStreamInfo.id;
458475
}, $scope);
459476

460477
$scope.player.on(dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED, function (e) {
@@ -1343,11 +1360,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
13431360
protectionData[input.drmKeySystem]['httpRequestHeaders'] = input.httpRequestHeaders;
13441361
}
13451362

1346-
if(input.audioRobustness){
1363+
if (input.audioRobustness) {
13471364
protectionData[input.drmKeySystem]['audioRobustness'] = input.audioRobustness;
13481365
}
13491366

1350-
if(input.videoRobustness){
1367+
if (input.videoRobustness) {
13511368
protectionData[input.drmKeySystem]['videoRobustness'] = input.videoRobustness;
13521369
}
13531370
} else {
@@ -1391,11 +1408,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
13911408
protectionData[input.drmKeySystem]['httpRequestHeaders'] = input.httpRequestHeaders;
13921409
}
13931410

1394-
if(input.audioRobustness){
1411+
if (input.audioRobustness) {
13951412
protectionData[input.drmKeySystem]['audioRobustness'] = input.audioRobustness;
13961413
}
13971414

1398-
if(input.videoRobustness){
1415+
if (input.videoRobustness) {
13991416
protectionData[input.drmKeySystem]['videoRobustness'] = input.videoRobustness;
14001417
}
14011418
}
@@ -2039,8 +2056,8 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
20392056
else if (value === 'null') typedValue = null;
20402057
else if (value === 'undefined') typedValue = undefined;
20412058
else integerRegEx.test(value) ? typedValue = parseInt(value) :
2042-
(floatRegEx.test(value) ? typedValue = parseFloat(value) :
2043-
typedValue = value);
2059+
(floatRegEx.test(value) ? typedValue = parseFloat(value) :
2060+
typedValue = value);
20442061

20452062
return typedValue;
20462063
}

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,14 @@ <h5><span class="label label-warning" style="margin-right:3px">Updated</span>Exp
10881088
Audio
10891089
</a>
10901090
</li>
1091+
<li><a href="#playbackStatsTab" role="tab" data-toggle="tab">
1092+
Playback
1093+
</a>
1094+
</li>
1095+
<li><a href="#mpdStatsTab" role="tab" data-toggle="tab">
1096+
MPD
1097+
</a>
1098+
</li>
10911099
</ul>
10921100

10931101
<!-- Tab panes -->
@@ -1303,6 +1311,36 @@ <h5><span class="label label-warning" style="margin-right:3px">Updated</span>Exp
13031311
</div>
13041312
</div>
13051313
</div>
1314+
<div class="tab-pane fade" id="playbackStatsTab">
1315+
<div class="panel-body panel-stats">
1316+
<!-- Playback STATS ITEMS-->
1317+
<div class="text-success">
1318+
<label class="text-primary" data-toggle="tooltip"
1319+
data-placement="top"
1320+
title="Active Period">Active Period ID:</label> {{activePeriod}}
1321+
</div>
1322+
<div class="text-success">
1323+
<label class="text-primary" data-toggle="tooltip"
1324+
data-placement="top"
1325+
title="Buffering Period">Buffering Period ID:</label> {{bufferingPeriod}}
1326+
</div>
1327+
</div>
1328+
</div>
1329+
<div class="tab-pane fade" id="mpdStatsTab">
1330+
<div class="panel-body panel-stats">
1331+
<!-- MPD STATS ITEMS-->
1332+
<div class="text-success">
1333+
<label class="text-primary" data-toggle="tooltip"
1334+
data-placement="top"
1335+
title="MPD Type">Type:</label> {{mpdType}}
1336+
</div>
1337+
<div class="text-success">
1338+
<label class="text-primary" data-toggle="tooltip"
1339+
data-placement="top"
1340+
title="The number of periods signaled in the MPD">Number of periods :</label> {{numberOfPeriods}}
1341+
</div>
1342+
</div>
1343+
</div>
13061344
</div>
13071345
</div>
13081346
</div>

0 commit comments

Comments
 (0)