change xhr handler
This commit is contained in:
parent
46950eb6d0
commit
7f380b4da5
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user