Add a standalone version with updated HLS.JS

This commit is contained in:
2020-04-12 14:23:19 +01:00
parent a287bac2fe
commit a9416936ef
3 changed files with 52 additions and 0 deletions

2
standalone/hls.light.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

49
standalone/index.html Normal file
View File

@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Video Player</title>
<style>
#vidPlayer {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
overflow: auto;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<video id="vidPlayer" controls></video>
<script src="hls.light.min.js"></script>
<script>
const vidPlayer = document.querySelector('#vidPlayer');
const urlParams = new URLSearchParams(window.location.search);
const url = `https://vdo.mwit.ac.th/live/${urlParams.get('channel')}/playlist.m3u8`;
console.log(url);
if (
!/Android|webOS|iPhone|iPad|iPod|Edge|iOS/i.test(navigator.userAgent) &&
Hls.isSupported() && false
) {
console.log("Using HLS.js");
hls = new Hls();
hls.loadSource(url);
hls.attachMedia(vidPlayer);
hls.on(Hls.Events.MANIFEST_PARSED, vidPlayer.play);
}
else {
vidPlayer.src = url;
vidPlayer.play();
}
</script>
</body>
</html>