Skip to content

Commit fec71f9

Browse files
nwebbernwebber
nwebber
authored and
nwebber
committed
Style the new stats.
1 parent e397939 commit fec71f9

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

app/main.js

+18-6
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ app.controller('DashController', function($scope, Sources, Notes, Contributors,
112112
$scope.videoMaxIndex = 0;
113113
$scope.videoBufferLength = 0;
114114
$scope.videoDroppedFrames = 0;
115+
$scope.videoLatencyCount = 0;
115116
$scope.videoLatency = "";
117+
$scope.videoDownloadCount = 0;
116118
$scope.videoDownload = "";
119+
$scope.videoRatioCount = 0;
117120
$scope.videoRatio = "";
118121

119122
$scope.audioBitrate = 0;
@@ -122,8 +125,11 @@ app.controller('DashController', function($scope, Sources, Notes, Contributors,
122125
$scope.audioMaxIndex = 0;
123126
$scope.audioBufferLength = 0;
124127
$scope.audioDroppedFrames = 0;
128+
$scope.videoLatencyCount = 0;
125129
$scope.audioLatency = "";
130+
$scope.audioDownloadCount = 0;
126131
$scope.audioDownload = "";
132+
$scope.audioRatioCount = 0;
127133
$scope.audioRatio = "";
128134

129135
var converter = new MetricsTreeConverter();
@@ -283,13 +289,16 @@ app.controller('DashController', function($scope, Sources, Notes, Contributors,
283289
$scope.videoBufferLength = metrics.bufferLengthValue;
284290
$scope.videoDroppedFrames = metrics.droppedFramesValue;
285291
if (metrics.movingLatency["video"]) {
286-
$scope.videoLatency = metrics.movingLatency["video"].count + "seg : " + metrics.movingLatency["video"].low + " < " + metrics.movingLatency["video"].average + " < " + metrics.movingLatency["video"].high;
292+
$scope.videoLatencyCount = metrics.movingLatency["video"].count;
293+
$scope.videoLatency = metrics.movingLatency["video"].low.toFixed(3) + " < " + metrics.movingLatency["video"].average.toFixed(3) + " < " + metrics.movingLatency["video"].high.toFixed(3);
287294
}
288295
if (metrics.movingDownload["video"]) {
289-
$scope.videoDownload = metrics.movingDownload["video"].count + "seg : " + metrics.movingDownload["video"].low + " < " + metrics.movingDownload["video"].average + " < " + metrics.movingDownload["video"].high;
296+
$scope.videoDownloadCount = metrics.movingDownload["video"].count;
297+
$scope.videoDownload = metrics.movingDownload["video"].low.toFixed(3) + " < " + metrics.movingDownload["video"].average.toFixed(3) + " < " + metrics.movingDownload["video"].high.toFixed(3);
290298
}
291299
if (metrics.movingRatio["video"]) {
292-
$scope.videoRatio = metrics.movingRatio["video"].count + "seg : " + metrics.movingRatio["video"].low + " < " + metrics.movingRatio["video"].average + " < " + metrics.movingRatio["video"].high;
300+
$scope.videoRatioCount = metrics.movingRatio["video"].count;
301+
$scope.videoRatio = metrics.movingRatio["video"].low.toFixed(3) + " < " + metrics.movingRatio["video"].average.toFixed(3) + " < " + metrics.movingRatio["video"].high.toFixed(3);
293302
}
294303

295304
point = [parseFloat(video.currentTime), Math.round(parseFloat(metrics.bufferLengthValue))];
@@ -311,13 +320,16 @@ app.controller('DashController', function($scope, Sources, Notes, Contributors,
311320
$scope.audioBufferLength = metrics.bufferLengthValue;
312321
$scope.audioDroppedFrames = metrics.droppedFramesValue;
313322
if (metrics.movingLatency["audio"]) {
314-
$scope.audioLatency = metrics.movingLatency["audio"].count + "seg : " + metrics.movingLatency["audio"].low + " < " + metrics.movingLatency["audio"].average + " < " + metrics.movingLatency["audio"].high;
323+
$scope.audioLatencyCount = metrics.movingLatency["audio"].count;
324+
$scope.audioLatency = metrics.movingLatency["audio"].low.toFixed(3) + " < " + metrics.movingLatency["audio"].average.toFixed(3) + " < " + metrics.movingLatency["audio"].high.toFixed(3);
315325
}
316326
if (metrics.movingDownload["audio"]) {
317-
$scope.audioDownload = metrics.movingDownload["audio"].count + "seg : " + metrics.movingDownload["audio"].low + " < " + metrics.movingDownload["audio"].average + " < " + metrics.movingDownload["audio"].high;
327+
$scope.audioDownloadCount = metrics.movingDownload["audio"].count;
328+
$scope.audioDownload = metrics.movingDownload["audio"].low.toFixed(3) + " < " + metrics.movingDownload["audio"].average.toFixed(3) + " < " + metrics.movingDownload["audio"].high.toFixed(3);
318329
}
319330
if (metrics.movingRatio["audio"]) {
320-
$scope.audioRatio = metrics.movingRatio["audio"].count + "seg : " + metrics.movingRatio["audio"].low + " < " + metrics.movingRatio["audio"].average + " < " + metrics.movingRatio["audio"].high;
331+
$scope.audioRatioCount = metrics.movingRatio["audio"].count;
332+
$scope.audioRatio = metrics.movingRatio["audio"].low.toFixed(3) + " < " + metrics.movingRatio["audio"].average.toFixed(3) + " < " + metrics.movingRatio["audio"].high.toFixed(3);
321333
}
322334

323335
point = [parseFloat(video.currentTime), Math.round(parseFloat(metrics.bufferLengthValue))];

index.html

+12-6
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,12 @@
220220
<p class="text-warning">{{videoBitrate}} kbps</p>
221221
<p class="text-primary">Rep Index: <span class="text-success">{{videoIndex}}</span><span class="text-warning">{{videoPendingIndex}}</span>/<span class="text-success">{{videoMaxIndex}}</span></p>
222222
<p class="text-primary">Buffer Length: <span class="text-success">{{videoBufferLength}}</span></p>
223-
<p class="text-primary">Latency: <span class="text-success">{{videoLatency}}</span></p>
224-
<p class="text-primary">Download: <span class="text-success">{{videoDownload}}</span></p>
225-
<p class="text-primary">Ratio: <span class="text-success">{{videoRatio}}</span></p>
223+
<p class="text-primary">Latency: <span class="text-success">last {{videoRatioCount}} segments</span></p>
224+
<p class="text-success" title="[low] < [average] < [high]">{{videoLatency}}</p>
225+
<p class="text-primary">Download: <span class="text-success">last {{videoRatioCount}} segments</span></p>
226+
<p class="text-success" title="[low] < [average] < [high]">{{videoDownload}}</p>
227+
<p class="text-primary">Ratio: <span class="text-success">last {{videoRatioCount}} segments</span></p>
228+
<p class="text-success" title="[low] < [average] < [high]">{{videoRatio}}</p>
226229
<p class="text-primary">Dropped Frames: <span class="text-success">{{videoDroppedFrames}}</span></p>
227230
</div>
228231
</div>
@@ -248,9 +251,12 @@
248251
<p class="text-warning">{{audioBitrate}} kbps</p>
249252
<p class="text-primary">Rep Index: <span class="text-success">{{audioIndex}}</span><span class="text-warning">{{audioPendingIndex}}</span>/<span class="text-success">{{audioMaxIndex}}</span></p>
250253
<p class="text-primary">Buffer Length: <span class="text-success">{{audioBufferLength}}</span></p>
251-
<p class="text-primary">Latency: <span class="text-success">{{audioLatency}}</span></p>
252-
<p class="text-primary">Download: <span class="text-success">{{audioDownload}}</span></p>
253-
<p class="text-primary">Ratio: <span class="text-success">{{audioRatio}}</span></p>
254+
<p class="text-primary">Latency: <span class="text-success">last {{audioLatencyCount}} segments</span></p>
255+
<p class="text-success" title="[low] < [average] < [high]">{{audioLatency}}</p>
256+
<p class="text-primary">Download: <span class="text-success">last {{audioDownloadCount}} segments</span></p>
257+
<p class="text-success" title="[low] < [average] < [high]">{{audioDownload}}</p>
258+
<p class="text-primary">Ratio: <span class="text-success">last {{audioRatioCount}} segments</span></p>
259+
<p class="text-success" title="[low] < [average] < [high]">{{audioRatio}}</p>
254260
</div>
255261
</div>
256262
</div>

0 commit comments

Comments
 (0)