stream-api/index.html
2021-05-12 09:31:48 +02:00

24 lines
849 B
HTML

<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ videojs_version }}/video-js.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ videojs_version }}/video.min.js"></script>
</head>
<body>
<video class="video-js" id="player" controls>
</video>
<script>
let xhr = new XmlHttpRequest();
xhr.onreadystatechange = () => {
let ctype = xhr.getResponseHeader("Content-Type");
let player = videojs("player");
let source = {};
source.type = ctype;
source.src = "{{ stream }}";
player.src(source);
}
xhr.open("HEAD", "{{ stream }}", true);
xhr.send();
</script>
</body>
</html>