From 9a5ef2ca60f1a96a44efda411d3b727bc5655ca9 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 12 May 2021 14:29:50 +0200 Subject: [PATCH] add video element to dom --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index ffcf4e8..7c3aaec 100644 --- a/script.js +++ b/script.js @@ -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();