Skip to content

Commit c752672

Browse files
authored
Add some additional debug outputs in the reference UI (#4870)
1 parent 6dee0b1 commit c752672

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
@@ -296,6 +296,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
296296
$scope.audioLiveLatency = 0;
297297
$scope.audioPlaybackRate = 1.00;
298298

299+
$scope.activePeriod = '';
300+
$scope.bufferingPeriod = '';
301+
302+
$scope.mpdType = '';
303+
$scope.numberOfPeriods = 0;
304+
299305
// Starting Options
300306
$scope.autoPlaySelected = true;
301307
$scope.autoLoadSelected = false;
@@ -436,6 +442,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
436442

437443
$scope.player.on(dashjs.MediaPlayer.events.MANIFEST_LOADED, function (e) {
438444
$scope.isDynamic = e.data.type === 'dynamic';
445+
if (e.data.Period) {
446+
$scope.numberOfPeriods = e.data.Period.length;
447+
}
448+
if (e.data.type) {
449+
$scope.mpdType = e.data.type;
450+
}
439451
}, $scope);
440452

441453

@@ -452,11 +464,16 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
452464
$scope[e.mediaType + 'Bitrate'] = bitrate;
453465
$scope.plotPoint('pendingIndex', e.mediaType, e.newQuality + 1, getTimeForPlot());
454466
$scope.safeApply();
467+
468+
if (e.currentRepresentation && e.currentRepresentation.adaptation && e.currentRepresentation.adaptation.period) {
469+
$scope.bufferingPeriod = e.currentRepresentation.adaptation.period.id;
470+
}
455471
}, $scope);
456472

457473

458474
$scope.player.on(dashjs.MediaPlayer.events.PERIOD_SWITCH_COMPLETED, function (e) {
459475
$scope.currentStreamInfo = e.toStreamInfo;
476+
$scope.activePeriod = e.toStreamInfo.id;
460477
}, $scope);
461478

462479
$scope.player.on(dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED, function (e) {
@@ -1481,11 +1498,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
14811498
protectionData[input.drmKeySystem]['httpRequestHeaders'] = input.httpRequestHeaders;
14821499
}
14831500

1484-
if(input.audioRobustness){
1501+
if (input.audioRobustness) {
14851502
protectionData[input.drmKeySystem]['audioRobustness'] = input.audioRobustness;
14861503
}
14871504

1488-
if(input.videoRobustness){
1505+
if (input.videoRobustness) {
14891506
protectionData[input.drmKeySystem]['videoRobustness'] = input.videoRobustness;
14901507
}
14911508
} else {
@@ -1529,11 +1546,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
15291546
protectionData[input.drmKeySystem]['httpRequestHeaders'] = input.httpRequestHeaders;
15301547
}
15311548

1532-
if(input.audioRobustness){
1549+
if (input.audioRobustness) {
15331550
protectionData[input.drmKeySystem]['audioRobustness'] = input.audioRobustness;
15341551
}
15351552

1536-
if(input.videoRobustness){
1553+
if (input.videoRobustness) {
15371554
protectionData[input.drmKeySystem]['videoRobustness'] = input.videoRobustness;
15381555
}
15391556
}
@@ -2177,8 +2194,8 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
21772194
else if (value === 'null') typedValue = null;
21782195
else if (value === 'undefined') typedValue = undefined;
21792196
else integerRegEx.test(value) ? typedValue = parseInt(value) :
2180-
(floatRegEx.test(value) ? typedValue = parseFloat(value) :
2181-
typedValue = value);
2197+
(floatRegEx.test(value) ? typedValue = parseFloat(value) :
2198+
typedValue = value);
21822199

21832200
return typedValue;
21842201
}

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,14 @@ <h5><span class="label label-warning" style="margin-right:3px">Updated</span>Exp
11041104
Audio
11051105
</a>
11061106
</li>
1107+
<li><a href="#playbackStatsTab" role="tab" data-toggle="tab">
1108+
Playback
1109+
</a>
1110+
</li>
1111+
<li><a href="#mpdStatsTab" role="tab" data-toggle="tab">
1112+
MPD
1113+
</a>
1114+
</li>
11071115
</ul>
11081116

11091117
<!-- Tab panes -->
@@ -1319,6 +1327,36 @@ <h5><span class="label label-warning" style="margin-right:3px">Updated</span>Exp
13191327
</div>
13201328
</div>
13211329
</div>
1330+
<div class="tab-pane fade" id="playbackStatsTab">
1331+
<div class="panel-body panel-stats">
1332+
<!-- Playback STATS ITEMS-->
1333+
<div class="text-success">
1334+
<label class="text-primary" data-toggle="tooltip"
1335+
data-placement="top"
1336+
title="Active Period">Active Period ID:</label> {{activePeriod}}
1337+
</div>
1338+
<div class="text-success">
1339+
<label class="text-primary" data-toggle="tooltip"
1340+
data-placement="top"
1341+
title="Buffering Period">Buffering Period ID:</label> {{bufferingPeriod}}
1342+
</div>
1343+
</div>
1344+
</div>
1345+
<div class="tab-pane fade" id="mpdStatsTab">
1346+
<div class="panel-body panel-stats">
1347+
<!-- MPD STATS ITEMS-->
1348+
<div class="text-success">
1349+
<label class="text-primary" data-toggle="tooltip"
1350+
data-placement="top"
1351+
title="MPD Type">Type:</label> {{mpdType}}
1352+
</div>
1353+
<div class="text-success">
1354+
<label class="text-primary" data-toggle="tooltip"
1355+
data-placement="top"
1356+
title="The number of periods signaled in the MPD">Number of periods :</label> {{numberOfPeriods}}
1357+
</div>
1358+
</div>
1359+
</div>
13221360
</div>
13231361
</div>
13241362
</div>

0 commit comments

Comments
 (0)