diff --git a/script.js b/script.js index 74cdd79..f7f8feb 100644 --- a/script.js +++ b/script.js @@ -3,7 +3,8 @@ document.addEventListener("DOMContentLoaded", () => { if(bodies.length === 1) { let body = bodies[0]; let xhr = new XMLHttpRequest(); - xhr.onreadystatechange = () => { + xhr.addEventListener("load", (e) => { + console.log(e); let video = document.createElement("video"); video.id = "video-player"; video.className = "video-js"; @@ -14,7 +15,7 @@ document.addEventListener("DOMContentLoaded", () => { source.type = ctype; source.src = "{{ stream }}"; player.src(source); - } + }); xhr.open("HEAD", "{{ stream }}", true); xhr.send(); }