From 2de6bd09d4f403db5ea24cfa376cf69a9b2c9c68 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Wed, 28 Feb 2024 19:00:54 +0100 Subject: [PATCH] small display fixes regarding stream url --- docker-compose.yaml | 1 + source/config/templates/config/stream_detail.html | 9 ++++++++- source/core/templatetags/__init__.py | 0 source/core/templatetags/core_templatetag.py | 9 +++++++++ source/portier/settings.py | 1 + srs.conf | 4 ++-- 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 source/core/templatetags/__init__.py create mode 100644 source/core/templatetags/core_templatetag.py diff --git a/docker-compose.yaml b/docker-compose.yaml index 0f31744..12ffb4f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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: diff --git a/source/config/templates/config/stream_detail.html b/source/config/templates/config/stream_detail.html index 5f6f07f..4352d6b 100644 --- a/source/config/templates/config/stream_detail.html +++ b/source/config/templates/config/stream_detail.html @@ -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 @@
{% trans "how_to_configure_your_encoder_header" %}

{% trans "set_this_stream_server_in_encoder" %}

-

rtmp://ingest.chaoswest.tv:1935/{{ object.application }}/

+

+

{% trans "set_this_stream_id_in_encoder" %}

diff --git a/source/core/templatetags/__init__.py b/source/core/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/source/core/templatetags/core_templatetag.py b/source/core/templatetags/core_templatetag.py new file mode 100644 index 0000000..589343d --- /dev/null +++ b/source/core/templatetags/core_templatetag.py @@ -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, "") \ No newline at end of file diff --git a/source/portier/settings.py b/source/portier/settings.py index 86fefd1..b303932 100644 --- a/source/portier/settings.py +++ b/source/portier/settings.py @@ -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 diff --git a/srs.conf b/srs.conf index 70d3aee..96334cb 100644 --- a/srs.conf +++ b/srs.conf @@ -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; } } \ No newline at end of file