add video element to dom

This commit is contained in:
Roy Olav Purser 2021-05-12 14:29:50 +02:00
parent f6c8a1d021
commit 9a5ef2ca60
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -6,6 +6,7 @@ document.addEventListener("DOMContentLoaded", () => {
let upstream = "{{ stream }}";
xhr.addEventListener("load", () => {
let video = document.createElement("video");
body.appendChild(video);
let ctype = xhr.getResponseHeader("Content-Type");
console.log(ctype);
let options = {};
@ -16,7 +17,6 @@ document.addEventListener("DOMContentLoaded", () => {
source.type = ctype;
source.src = upstream;
player.src(source);
body.appendChild(video);
});
xhr.open("HEAD", upstream, true);
xhr.send();