Update user agent string

This commit is contained in:
2018-10-27 01:36:35 +01:00
parent 9af01fa808
commit cb8137007e

View File

@@ -54,23 +54,25 @@ const createVidList = () => {
} }
const changeVid = index => { const changeVid = index => {
titleText.innerHTML = vids[index].name; console.log("Switching video to index", index);
titleText.innerHTML = vids[index].name;
if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) && if(!/Android|webOS|iPhone|iPad|iPod|Edge|iOS/i.test(navigator.userAgent) &&
Hls.isSupported() && Hls.isSupported() &&
vids[index].url.endsWith(".m3u8")) { vids[index].url.endsWith(".m3u8")) {
if(!hls==null) { console.log("Using HLS.js");
hls.detachMedia(vidPlayer); if(!hls==null) {
} hls.detachMedia(vidPlayer);
hls = new Hls();
hls.loadSource(vids[index].url);
hls.attachMedia(vidPlayer);
hls.on(Hls.Events.MANIFEST_PARSED,()=>{video.play();});
}
else {
vidPlayer.src = vids[index].url;
vidPlayer.play();
} }
hls = new Hls();
hls.loadSource(vids[index].url);
hls.attachMedia(vidPlayer);
hls.on(Hls.Events.MANIFEST_PARSED,()=>{video.play();});
}
else {
vidPlayer.src = vids[index].url;
vidPlayer.play();
}
} }
createVidList(); createVidList();