From ee82c7082c2441186bbe00e19c47494245c730d3 Mon Sep 17 00:00:00 2001 From: deflax Date: Tue, 12 Oct 2021 16:46:24 +0000 Subject: [PATCH] provide hlsindex for the api --- frontend/app/frontend.py | 6 +++--- frontend/app/templates/default/main.html.j2 | 16 +++++++++++----- frontend/app/templates/default/player.html.j2 | 4 ++-- frontend/app/zomstream.py | 4 +++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/frontend/app/frontend.py b/frontend/app/frontend.py index 22e40df..00c52a3 100644 --- a/frontend/app/frontend.py +++ b/frontend/app/frontend.py @@ -21,12 +21,12 @@ def start(): ) return page -@frontend.route("/player//") -def show_player(appname, streamname): +@frontend.route("/player//") +def show_player(appname, hlsindex): playerTemplate = '%s/player.html.j2' % zomstream.configuration['template_folder'] page = flask.render_template( playerTemplate, - streamname=streamname, + hlsindex=hlsindex, appname=appname, configuration=zomstream.configuration ) diff --git a/frontend/app/templates/default/main.html.j2 b/frontend/app/templates/default/main.html.j2 index afbb1f6..7f723a7 100644 --- a/frontend/app/templates/default/main.html.j2 +++ b/frontend/app/templates/default/main.html.j2 @@ -18,7 +18,7 @@ {% endif %} {% for item in items %}
-

{{ item[1] }}

+

Stream {{ item[1] }}

@@ -27,20 +27,26 @@ - - - + + + - +
RTMP urlrtmp://{{ configuration["rtmp_base"] }}/{{ item[0] }}/{{ item[1] }}
RTMP
RTMP substream {{ item[2] }}rtmp://{{ configuration["rtmp_base"] }}/{{ item[0] }}/{{ item[2] }}
RTMP
HLS m3u8 {{ configuration['web_proto'] }}://{{ configuration['base_url'] }}/hls/{{ item[1] }}/index.m3u8
HLS.js

HLS.js
{% endfor %} + + + ▷ Web Player + +