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