request media directely

This commit is contained in:
2021-05-29 16:02:12 +02:00
parent f76f084c01
commit 4f2501ed98
2 changed files with 5 additions and 2 deletions

View File

@ -26,6 +26,7 @@
video.className = "video-js vjs-big-play-centered";
body.appendChild(video);
const ctype = xhr.getResponseHeader("Content-Type");
const media = xhr.getResponseHeader("Content-Location");
const image = xhr.getResponseHeader("Custom-Poster");
console.log(ctype);
const options = {};
@ -43,7 +44,7 @@
}
const source = {};
source.type = ctype;
source.src = upstream;
source.src = media;
player.src(source);
const canPlayTypeRaw = player.canPlayType(ctype);
const canPlayType = (canPlayTypeRaw === "maybe") || (canPlayTypeRaw === "probably");