print ctype

This commit is contained in:
Roy Olav Purser 2021-05-12 10:53:33 +02:00
parent 7f380b4da5
commit 3ccbef047e
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -3,20 +3,21 @@ document.addEventListener("DOMContentLoaded", () => {
if(bodies.length === 1) {
let body = bodies[0];
let xhr = new XMLHttpRequest();
xhr.addEventListener("load", (e) => {
console.log(e);
let upstream = "{{ stream }}";
xhr.addEventListener("load", () => {
let video = document.createElement("video");
video.id = "video-player";
video.className = "video-js";
body.appendChild(video);
let ctype = xhr.getResponseHeader("Content-Type");
console.log(ctype);
let player = videojs("video-player");
let source = {};
source.type = ctype;
source.src = "{{ stream }}";
source.src = upstream;
player.src(source);
});
xhr.open("HEAD", "{{ stream }}", true);
xhr.open("HEAD", upstream, true);
xhr.send();
}
});