diff --git a/roles/nginx-rtmp/templates/index.html b/roles/nginx-rtmp/templates/index.html index 36134d85..45e5839c 100644 --- a/roles/nginx-rtmp/templates/index.html +++ b/roles/nginx-rtmp/templates/index.html @@ -8,7 +8,7 @@ </head> <body class="bg-dark m-2"> <div class="container"> - <video id="my-video" class="video-js embed-responsive shadow-lg rounded-sm"></video> + <video id="my-video" class="video-js embed-responsive embed-responsive-16by9 shadow-lg rounded-sm"></video> </div> <script src="//unpkg.com/video.js@7/dist/video.min.js"></script> @@ -18,7 +18,9 @@ controls: true, autoplay: true, preload: 'auto', - muted: true + muted: true, + fluid: true, + aspectRatio: '16:9' }).src({ type: 'application/x-mpegURL', src: `/hls/${videoId}.m3u8` diff --git a/roles/nginx-rtmp/templates/nginx/modules-available/60-rtmp.conf.j2 b/roles/nginx-rtmp/templates/nginx/modules-available/60-rtmp.conf.j2 index dda34d59..e780fb6c 100644 --- a/roles/nginx-rtmp/templates/nginx/modules-available/60-rtmp.conf.j2 +++ b/roles/nginx-rtmp/templates/nginx/modules-available/60-rtmp.conf.j2 @@ -1,16 +1,18 @@ -rtmp { - server { - listen 1935; - chunk_size 4096; - application live { - live on; - hls on; - hls_path /var/www/stream/hls/; - hls_fragment 3; - hls_playlist_length 60; +{{ ansible_header | comment }} - record off; +rtmp { + server { + listen 1935; + chunk_size 4096; + application live { + live on; + hls on; + hls_path /var/www/stream/hls/; + hls_fragment 3; + hls_playlist_length 20; + + record off; + } } - } } diff --git a/roles/nginx-rtmp/templates/nginx/sites-available/stream.j2 b/roles/nginx-rtmp/templates/nginx/sites-available/stream.j2 index 9fa05998..2a074c8d 100644 --- a/roles/nginx-rtmp/templates/nginx/sites-available/stream.j2 +++ b/roles/nginx-rtmp/templates/nginx/sites-available/stream.j2 @@ -1,6 +1,8 @@ +{{ ansible_header | comment }} + server { listen 80; - listen [::]:80; + listen [::]:80; server_name {{ nginx_rtmp.uri }}; diff --git a/roles/nginx-rtmp/templates/rtmp.conf.j2 b/roles/nginx-rtmp/templates/rtmp.conf.j2 deleted file mode 100644 index f6a926f7..00000000 --- a/roles/nginx-rtmp/templates/rtmp.conf.j2 +++ /dev/null @@ -1,11 +0,0 @@ -rtmp { - server { - listen 1935; - chunk_size 4096; - application live { - live on; - record off; - } - } -} -