request media directely
This commit is contained in:
parent
f76f084c01
commit
4f2501ed98
@ -269,9 +269,11 @@ class MainHandler(tornado.web.RequestHandler):
|
|||||||
upstream_proxy = await handler.proxy.proxy_url(upstream, None)
|
upstream_proxy = await handler.proxy.proxy_url(upstream, None)
|
||||||
ctype = await handler.proxy.content_type(upstream_proxy)
|
ctype = await handler.proxy.content_type(upstream_proxy)
|
||||||
self.set_header("Content-Type", ctype)
|
self.set_header("Content-Type", ctype)
|
||||||
self.set_header("Content-Location", upstream_proxy)
|
|
||||||
if redir:
|
if redir:
|
||||||
self.redirect(upstream_proxy, status=303)
|
self.redirect(upstream_proxy, status=303)
|
||||||
|
else:
|
||||||
|
self.set_header("Content-Location", upstream_proxy)
|
||||||
|
|
||||||
async def get(self):
|
async def get(self):
|
||||||
await self.handle_any(True)
|
await self.handle_any(True)
|
||||||
async def head(self):
|
async def head(self):
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
video.className = "video-js vjs-big-play-centered";
|
video.className = "video-js vjs-big-play-centered";
|
||||||
body.appendChild(video);
|
body.appendChild(video);
|
||||||
const ctype = xhr.getResponseHeader("Content-Type");
|
const ctype = xhr.getResponseHeader("Content-Type");
|
||||||
|
const media = xhr.getResponseHeader("Content-Location");
|
||||||
const image = xhr.getResponseHeader("Custom-Poster");
|
const image = xhr.getResponseHeader("Custom-Poster");
|
||||||
console.log(ctype);
|
console.log(ctype);
|
||||||
const options = {};
|
const options = {};
|
||||||
@ -43,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
const source = {};
|
const source = {};
|
||||||
source.type = ctype;
|
source.type = ctype;
|
||||||
source.src = upstream;
|
source.src = media;
|
||||||
player.src(source);
|
player.src(source);
|
||||||
const canPlayTypeRaw = player.canPlayType(ctype);
|
const canPlayTypeRaw = player.canPlayType(ctype);
|
||||||
const canPlayType = (canPlayTypeRaw === "maybe") || (canPlayTypeRaw === "probably");
|
const canPlayType = (canPlayTypeRaw === "maybe") || (canPlayTypeRaw === "probably");
|
||||||
|
Loading…
Reference in New Issue
Block a user