diff --git a/apps/ex_nvr_web/assets/js/app.js b/apps/ex_nvr_web/assets/js/app.js index 67798d0f..a6bea90b 100644 --- a/apps/ex_nvr_web/assets/js/app.js +++ b/apps/ex_nvr_web/assets/js/app.js @@ -132,14 +132,16 @@ startStreaming = (src, poster_url) => { }) window.hls.loadSource(src) window.hls.attachMedia(video) - + window.hls.on(Hls.Events.LEVEL_LOADED, (event, data) => { - const { level } = data; + const { level, stats } = data; + console.log(data) const levelInfo = window.hls.levels[level]; - + const mbpsFactor = 1024 * 1024 infoBox.innerHTML = ` -
Bitrate: ${levelInfo.bitrate}
-Avg.Bitrate: ${levelInfo.averageBitrate}
+Bandwith Estimate: ${(window.hls.bandwidthEstimate / mbpsFactor).toFixed(3)} (Mbps)
+Bitrate: ${(levelInfo.bitrate / mbpsFactor).toFixed(3)} (Mbps)
+Avg.Bitrate: ${(levelInfo.averageBitrate / mbpsFactor).toFixed(3)} (Mbps)
Resolution: ${levelInfo.width}x${levelInfo.height}
Codecs: ${levelInfo.attrs.CODECS}
`;