Attempt for ios

This commit is contained in:
Thomas Forgione 2021-06-10 09:57:09 +02:00
parent c43e989459
commit a7c1f13f99
1 changed files with 24 additions and 32 deletions

View File

@ -38,6 +38,7 @@
app.ports.initVideo.subscribe(function(arg) {
const video = document.getElementById('video');
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(arg);
@ -62,17 +63,8 @@
})
hls.attachMedia(video);
function updateQuality(newQuality) {
if (newQuality === 0) {
hls.currentLevel = -1;
} else {
hls.levels.forEach((level, levelIndex) => {
if (level.height === newQuality) {
hls.currentLevel = levelIndex;
}
});
}
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = arg;
}
});