Add playHLS files

This commit is contained in:
Max Goodhart
2022-06-05 15:34:42 -07:00
parent fd75dba562
commit 9de3ffd1e2
2 changed files with 28 additions and 0 deletions

14
src/browser/playHLS.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Streamwall HLS Player</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; connect-src *; media-src * blob:"
/>
</head>
<body>
<script src="playHLS.js" type="module"></script>
</body>
</html>

14
src/browser/playHLS.js Normal file
View File

@@ -0,0 +1,14 @@
import Hls from 'hls.js'
const searchParams = new URLSearchParams(location.search)
const src = searchParams.get('src')
const videoEl = document.createElement('video')
var hls = new Hls()
hls.attachMedia(videoEl)
hls.loadSource(src)
hls.on(Hls.Events.MANIFEST_PARSED, () => {
document.body.appendChild(videoEl)
})