print ctype
This commit is contained in:
parent
7f380b4da5
commit
3ccbef047e
@ -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();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user