Attempt for ios
This commit is contained in:
parent
c43e989459
commit
a7c1f13f99
14
index.html
14
index.html
|
@ -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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue