我打算显示我的VOD流(基于DASH-MPEG,请参见下面的代码)的实时吞吐量(kbps),但是主要问题是我碰巧无法获得基于MediaPlayer()的相关功能在我的javascript函数(HTML5,内置)中获取它。有人能帮助我指出当前的dash.js实现中是否有可能输出此类输出吗? Throughputrule.js和其他基于规则的文件似乎暗示着这种吞吐量功能的存在,但是MediaPlayer-module无法调用它们,这似乎......在此先感谢您

    <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 + " kbps";
},1000)

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

10-09 23:12