From 63489d75dca192ea810d8c832f363b844c6cd454 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Thu, 13 May 2021 15:44:43 +0200 Subject: [PATCH] maxheight and maxwidth oembed --- stream.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stream.py b/stream.py index 3f634c1..ba72847 100755 --- a/stream.py +++ b/stream.py @@ -190,14 +190,16 @@ class MainHandler(tornado.web.RequestHandler): self.set_status(404) self.write("HTML template missing.") def handle_embed(self, provider): + max_width = self.get_query_argument("maxwidth", "320") + max_height = self.get_query_argument("maxheight", "180") origin = self.request.path if stream_server is not None: origin = f'{stream_server}{self.request.path}' embed_json = {} embed_json["version"] = "1.0" embed_json["type"] = "video" - embed_json["width"] = "640" - embed_json["height"] = "360" + embed_json["width"] = max_width + embed_json["height"] = max_height embed_json["html"] = str(template_embed.generate(origin=origin, provider=provider), "utf-8") self.set_header("Content-Type", "application/json; charset=utf-8") self.write(json.dumps(embed_json))