Skip to content

Commit

Permalink
Fix monitoring sample and add missing framerate (#4476)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed May 8, 2024
1 parent de94e50 commit 7f335b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions samples/advanced/monitoring.html
Expand Up @@ -48,10 +48,7 @@
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 currentRep = adaptation.Representation.find(function (rep) {
return rep.id === repSwitch.to
})
var currentRep = player.getCurrentRepresentationForType('video');
var frameRate = currentRep.frameRate;
var resolution = currentRep.width + 'x' + currentRep.height;
document.getElementById('bufferLevel').innerText = bufferLevel + " secs";
Expand Down Expand Up @@ -116,7 +113,7 @@ <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>
Expand Down
3 changes: 3 additions & 0 deletions src/dash/models/DashManifestModel.js
Expand Up @@ -649,6 +649,9 @@ function DashManifestModel() {
if (realRepresentation.hasOwnProperty(DashConstants.SCAN_TYPE)) {
voRepresentation.scanType = realRepresentation.scanType;
}
if (realRepresentation.hasOwnProperty(DashConstants.FRAMERATE)) {
voRepresentation.frameRate = realRepresentation[DashConstants.FRAMERATE];
}
if (realRepresentation.hasOwnProperty(DashConstants.QUALITY_RANKING)) {
voRepresentation.qualityRanking = realRepresentation[DashConstants.QUALITY_RANKING];
}
Expand Down

0 comments on commit 7f335b4

Please sign in to comment.