-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
29 lines (28 loc) · 938 Bytes
/
index.html
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
28
<html>
<link rel="shortcut icon" href="about:blank"/>
<body>
<!--fill streamList variable with the list of streams -->
<script src="/getStreamList?streamList" ></script>
<h3>HLS</h3>
<video controls id="hlsvideo"></video>
<script src="hls.js/dist/hls.light.min.js" ></script>
<script>
if (Hls.isSupported()) {
var video = document.getElementById("hlsvideo");
var hls = new Hls();
hls.loadSource(streamList[0]+".m3u8");
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() { video.play(); });
} else {
document.write("HLS not supported");
}
</script>
<h3>MPEG-DASH</h3>
<video controls id="dashvideo"></video>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.5.0/dash.all.min.js" ></script>
<script>
var player = new dashjs.MediaPlayer().create();
player.initialize(document.getElementById("dashvideo"),streamList[0]+".mpd",true);
</script>
</body>
</html>