diff options
author | MaZderMind | 2018-01-25 00:02:11 +0100 |
---|---|---|
committer | MaZderMind | 2018-01-25 00:02:11 +0100 |
commit | 307115a74aa236b62c9a6af2cd2d7e1694a878b8 (patch) | |
tree | e33f5196cb7e97655044629b8e3972f279ab9965 /template/assemblies | |
parent | 7f066f2e9c382fe8c12a2a607c4576e1ee38f87c (diff) |
dash / select level-name based on bitrate instead of stream-index
Diffstat (limited to 'template/assemblies')
-rw-r--r-- | template/assemblies/player/dash.phtml | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/template/assemblies/player/dash.phtml b/template/assemblies/player/dash.phtml index 24a3df6..77ad7b5 100644 --- a/template/assemblies/player/dash.phtml +++ b/template/assemblies/player/dash.phtml @@ -60,23 +60,18 @@ } }, levelSelectorConfig: { - labels: { - // HLS - 0: 'Slides', - 1: 'SD', - 2: 'HD', - - // DASH - 7: 'HD', - 8: 'SD', - 9: 'Slides', - 10: 'HD', - 11: 'SD', - 12: 'Slides', - 13: 'HD', - 14: 'SD', - 15: 'Slides', - } + labelCallback: function(playbackLevel, customLabel) { + var bw=playbackLevel.videoBandwidth; + if(bw <= 100000) { + return 'Slides'; + } + else if(bw <= 800000) { + return 'SD'; + } + else { + return 'HD' + } + }, }, autoPlay: true, parentId: '#player' |