mirror of
https://github.com/redlib-org/redlib.git
synced 2025-04-05 05:57:40 +03:00
Make highest quality default
This commit is contained in:
parent
db6238394a
commit
9f10c2d5d2
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@
|
||||||
hls.loadSource(playlist);
|
hls.loadSource(playlist);
|
||||||
hls.attachMedia(newVideo);
|
hls.attachMedia(newVideo);
|
||||||
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
||||||
hls.loadLevel = 0;
|
hls.loadLevel = hls.levels.length - 1;
|
||||||
var availableLevels = hls.levels.map(function(level) {
|
var availableLevels = hls.levels.map(function(level) {
|
||||||
return {
|
return {
|
||||||
height: level.height,
|
height: level.height,
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
option.text = level.height + 'p (' + bitrate + ' kbps)';
|
option.text = level.height + 'p (' + bitrate + ' kbps)';
|
||||||
qualitySelector.appendChild(option);
|
qualitySelector.appendChild(option);
|
||||||
});
|
});
|
||||||
|
qualitySelector.selectedIndex = availableLevels.length - 1;
|
||||||
qualitySelector.addEventListener('change', function () {
|
qualitySelector.addEventListener('change', function () {
|
||||||
var selectedIndex = qualitySelector.selectedIndex;
|
var selectedIndex = qualitySelector.selectedIndex;
|
||||||
hlsInstance.nextLevel = selectedIndex;
|
hlsInstance.nextLevel = selectedIndex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue