-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadaptive_dash.php
31 lines (27 loc) · 930 Bytes
/
adaptive_dash.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php include_once "navbar.php" ?>
<div class="container">
<div class="row">
<video id="videoPlayer" width="512" height="288" controls poster="img/nature2_thumbnail2.png"></video>
</div>
</div>
<script>
var url = "video/nature2/nature2.mpd";
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
player.updateSettings({
'debug': {
'logLevel': dashjs.Debug.LOG_LEVEL_NONE
}
});
player.on("streamInitialized", function() {
var bitrates = player.getBitrateInfoListFor("video");
console.log("list of all bitrates:", bitrates);
});
player.on("qualityChangeRendered", function() {
var index = player.getQualityFor("video");
var bitrates = player.getBitrateInfoListFor("video");
var current = bitrates[index];
console.log("Current index is: ", index, current);
});
</script>
<?php include_once "footer.php" ?>