RTMP
HTTP-FLV
From 55f57996a1d741f54383a6a50095c5b9a705a71a Mon Sep 17 00:00:00 2001 From: Christoph <43646576+z-bsod@users.noreply.github.com> Date: Mon, 6 Dec 2021 22:31:54 +0100 Subject: [PATCH] Frontend Improvements (#11) * add OBS setup helper page * add rtmp and http url to player page as these aren't accessible from the main page for unlisted streams it might be helpful to have them listed on the player page for users which want to use external media players * add player URLs to setup_helper * change url display; add copy to clipboard function; css changes * use different sample password * make example config work ootb with docker-compose.default.yml --- config/frontend/config.example.yml | 6 +- docker-compose.default.yml | 2 +- frontend/app/frontend.py | 9 ++ frontend/app/static/style.default.css | 54 ++++++- frontend/app/templates/default/main.html.j2 | 46 +++++- frontend/app/templates/default/player.html.j2 | 61 ++++++++ .../templates/default/setup_helper.html.j2 | 146 ++++++++++++++++++ 7 files changed, 309 insertions(+), 15 deletions(-) create mode 100644 frontend/app/templates/default/setup_helper.html.j2 diff --git a/config/frontend/config.example.yml b/config/frontend/config.example.yml index 9586428..8fe7b18 100644 --- a/config/frontend/config.example.yml +++ b/config/frontend/config.example.yml @@ -1,12 +1,12 @@ # This is the title and Subtitle displayed on the Head of the Page pagetitle: Zomstream -subtitle: v0.4 +subtitle: v0.5 # the footer footer: "© 2021 by the zom.bi Team" # the ip or hostname used to generate rtmp URLs -rtmp_base: stream.zom.bi +rtmp_base: 127.0.0.1 # this is the base url used to generate internal links -base_url: 127.0.0.1:5001 +base_url: 127.0.0.1:8080 # the url to the nginx servers status page. # this is used for discovering the running streams diff --git a/docker-compose.default.yml b/docker-compose.default.yml index 9466e8f..dd069e9 100644 --- a/docker-compose.default.yml +++ b/docker-compose.default.yml @@ -15,7 +15,7 @@ services: - "./auth:/code" # set the PSK Password for the Auth Daemon here environment: - - password=ex4mple_p4ssw0rd! + - password=P4ssW0rD nginx-rtmp: # nginx rtmp server build: ./docker-nginx-rtmp/. diff --git a/frontend/app/frontend.py b/frontend/app/frontend.py index 22e40df..8338c18 100644 --- a/frontend/app/frontend.py +++ b/frontend/app/frontend.py @@ -31,3 +31,12 @@ def show_player(appname, streamname): configuration=zomstream.configuration ) return page + +@frontend.route("/setup_helper") +def setup_helper(): + template = '%s/setup_helper.html.j2' % zomstream.configuration['template_folder'] + page = flask.render_template( + template, + configuration=zomstream.configuration + ) + return page \ No newline at end of file diff --git a/frontend/app/static/style.default.css b/frontend/app/static/style.default.css index 48c8803..a25ce24 100644 --- a/frontend/app/static/style.default.css +++ b/frontend/app/static/style.default.css @@ -32,6 +32,11 @@ header h2 { margin: 2px; } +header h2 a { + font-style: normal; + color: #555; +} + main { clear: both; margin-left: auto; @@ -54,6 +59,30 @@ article { padding: 0px; } +form { + margin: 4px; +} + +article p { + margin: 4px; +} + +form label { + display: block; + margin-top: 8px; +} + +input, select { + width: 100%; + border: 1px solid #888; + border-radius: 3px; + box-sizing: border-box; +} + +input:focus { + border: 1px solid #88f; +} + article h1 { font-size: 13pt; font-weight: normal; @@ -84,7 +113,7 @@ article table td { border-bottom: 1px solid #eee; } -article table td em.url { +article table td em.url, input.url { font-style: normal; font-family: monospace; background: #eee; @@ -100,7 +129,17 @@ article table th.btn { text-align: right; } -a.btn { +form button.btn-large { + border: none; +} + +td.btn button.btn { + border: none; + width: 100%; + height: 100%; +} + +a.btn, button.btn { color: #eee; display: block; border-radius: 5px; @@ -111,15 +150,15 @@ a.btn { text-align: center; } -a.btn-green { +a.btn-green, button.btn, button.btn-large { background-color: rgb(44, 57, 75); /*background: linear-gradient(#4caf50, #2b622d);*/ } -a.btn-green:hover { +a.btn-green:hover, button.btn:hover { background-color: rgb(60, 78, 104); box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); } -a.btn-large { +a.btn-large, button.btn-large { color: #eee; font-size: 16pt; display: block; @@ -191,6 +230,9 @@ video#player { header h2 { color: #777; } + header h2 a { + color: #999; + } footer { color: #999; } @@ -208,7 +250,7 @@ video#player { article table td { border-bottom: 1px solid #333; } - article table td em.url { + article table td em.url, input.url { color: #eee; background: #121212; } diff --git a/frontend/app/templates/default/main.html.j2 b/frontend/app/templates/default/main.html.j2 index e9fb218..8b8720e 100644 --- a/frontend/app/templates/default/main.html.j2 +++ b/frontend/app/templates/default/main.html.j2 @@ -8,7 +8,7 @@