Add a standalone version with updated HLS.JS
This commit is contained in:
2
standalone/hls.light.min.js
vendored
Normal file
2
standalone/hls.light.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
standalone/hls.light.min.js.map
Normal file
1
standalone/hls.light.min.js.map
Normal file
File diff suppressed because one or more lines are too long
49
standalone/index.html
Normal file
49
standalone/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user