gpt4 book ai didi

javascript - MPEG DASH - 获取 VOD 流的平均吞吐量/比特率

转载 作者:行者123 更新时间:2023-12-03 04:13:36 27 4
gpt4 key购买 nike

我打算显示我的 VOD 流(基于 DASH-MPEG,请参阅下面的代码)的实时吞吐量 (kbps),但主要问题是我碰巧未能获得基于 MediaPlayer() 的,在我的 javascript 函数(HTML5,内置)中获取它的相关函数。有谁能够帮助我并指出是否可以从当前的 dash.js 实现中获得此类输出? Throughputrule.js 和其他基于规则的文件似乎暗示了此类吞吐量函数的存在,但它们似乎无法被 MediaPlayer 模块调用......提前谢谢

    <script src="http://mediapm.edgesuite.net/dash/public/nightly/dist/dash.all.min.js"></script>

<script type="application/javascript">

var playervar = dashjs.MediaPlayer().create();
playervar.initialize(document.querySelector("#videoStart"),"somekindofmanifest.mpd", false);
var buildin = document.getElementById("Divbuilt");
<!--buildin attaches this real-time function to the div-section of my html page-->

setInterval(function() {
<!--what I wanted to address with this issue-->
buildin.innerHTML= "the bitrate level is currently " + bitrate + " kbps";},1000)
</script>

最佳答案

setInterval(function() {
// get current quality index
var currentQualityIndex = playervar.getQualityFor('video');

// playervar.getBitrateInfoListFor('video') -- returns array of all qualities
var currentQualityObject = playervar.getBitrateInfoListFor('video')[currentQualityIndex];

var bitrate = currentQualityObject.bitrate;
buildin.innerHTML= "the bitrate level is currently " + (bitrate / 1000) + " kbps";
},1000)

关于javascript - MPEG DASH - 获取 VOD 流的平均吞吐量/比特率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44237158/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com