add sample of dash player
parent
33ae610128
commit
b4c917ead6
@ -1,17 +1,25 @@
|
||||
<html>
|
||||
<link rel="shortcut icon" href="about:blank"/>
|
||||
<body>
|
||||
<video controls id="video"></video>
|
||||
<script src="https://cdn.jsdelivr.net/hls.js/latest/hls.js" ></script>
|
||||
<h3>HLS</h3>
|
||||
<video controls id="hlsvideo"></video>
|
||||
<script src="https://cdn.jsdelivr.net/hls.js/latest/hls.min.js" ></script>
|
||||
<script>
|
||||
if (Hls.isSupported()) {
|
||||
var video = document.getElementById("video");
|
||||
var video = document.getElementById("hlsvideo");
|
||||
var hls = new Hls();
|
||||
hls.loadSource("unicast.m3u8");
|
||||
hls.attachMedia(video);
|
||||
hls.on(Hls.Events.MANIFEST_PARSED, function() { video.play(); });
|
||||
}
|
||||
</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"),"unicast.mpd",true);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Reference in New Issue