-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.html
More file actions
27 lines (27 loc) · 938 Bytes
/
player.html
File metadata and controls
27 lines (27 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width; height=device-height;">
<title>Stupid Media Player</title>
<link rel="stylesheet" href="resource://content-accessible/TopLevelVideoDocument.css">
<script type="text/javascript" src="chrome://global/content/TopLevelVideoDocument.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
</head>
<body>
<video id="video" controls></video>
<script>
let params = new URLSearchParams(document.location.search);
let url = params.get("url");
if(Hls.isSupported()) {
let video = document.getElementById('video');
let hls = new Hls();
hls.loadSource(url);
hls.startLevel = hls.levels.length - 1;
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
}
</script>
</body>
</html>