small display fixes regarding stream url

This commit is contained in:
Jan Koppe 2024-02-28 19:00:54 +01:00
parent 72824d32d4
commit 2de6bd09d4
Signed by: thunfisch
GPG Key ID: BE935B0735A2129B
6 changed files with 21 additions and 3 deletions

View File

@ -23,6 +23,7 @@ services:
- "EMAIL_HOST=${EMAIL_HOST}"
- "EMAIL_HOST_USER=${EMAIL_HOST_USER}"
- "EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}"
- "ADVERTISED_RTMP_HOSTS=localhost:1935 laserpope:1234"
redis:
image: redis:7-alpine
postgres:

View File

@ -3,6 +3,7 @@
{% load bootstrap4 %}
{% load fontawesome_5 %}
{% load guardian_tags %}
{% load core_templatetag %}
{% get_obj_perms user for object as "obj_perms" %}
@ -31,7 +32,13 @@
<h6>{% trans "how_to_configure_your_encoder_header" %}</h6>
<hr class="my-4">
<p>{% trans "set_this_stream_server_in_encoder" %}</p>
<p class="mb-4"><code>rtmp://ingest.chaoswest.tv:1935/{{ object.application }}/</code></p>
<p class="mb-4">
<ul>
{% settings_value "ADVERTISED_RTMP_HOSTS" as hosts %}
{% for host in hosts %}
<li><code>rtmp://{{ host }}/{% settings_value "GLOBAL_STREAM_NAMESPACE" %}/</code></p>
{% endfor %}
</ul>
<p>{% trans "set_this_stream_id_in_encoder" %}</p>
<div class="input-group mb-4" id="show_hide_stream_key">
<input readonly class="form-control" type="password" value="{{ object.stream }}">

View File

View File

@ -0,0 +1,9 @@
from django import template
from django.conf import settings
register = template.Library()
# settings value
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")

View File

@ -31,6 +31,7 @@ CSRF_TRUSTED_ORIGINS = os.environ.get("DJANGO_CSRF_TRUSTED_ORIGINS", default="ht
DEFAULT_GROUP = 'default'
GLOBAL_STREAM_NAMESPACE = 'live'
ADVERTISED_RTMP_HOSTS = os.environ.get("ADVERTISED_RTMP_HOSTS", default="localhost").split(" ")
# Application definition

View File

@ -24,7 +24,7 @@ vhost __defaultVhost__ {
}
http_hooks {
enabled on;
on_publish http://app/rtmp/callback/srs;
on_unpublish http://app/rtmp/callback/srs;
on_publish http://app/config/callback/srs;
on_unpublish http://app/config/callback/srs;
}
}