From 832cb493570ce6df49f7285dfd662ef1c89e0d5a Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 12 May 2021 01:04:45 +0200 Subject: [PATCH] dynamic content type --- index.html | 3 +-- stream.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 0672602..88d0580 100644 --- a/index.html +++ b/index.html @@ -5,8 +5,7 @@ diff --git a/stream.py b/stream.py index e03214a..b892000 100755 --- a/stream.py +++ b/stream.py @@ -150,7 +150,9 @@ class MainHandler(tornado.web.RequestHandler): def handle_render(self, provider, write): if template is not None: stream_path = f'{self.request.path}?provider={provider}' - rendered = template.generate(stream=stream_path, videojs_version=videojs_version) + stream_url = f'http://127.0.0.1:8080{stream_path}' + ctype = upstream_type(stream_url, None) + rendered = template.generate(stream=stream_path, content_type=ctype, videojs_version=videojs_version) self.write(rendered) else: self.set_status(404)