Adding separate videojs RTMP URL configuration variable to stream theme

This commit is contained in:
Benjamin Southall 2016-12-10 18:18:27 +09:00
parent bd3cc25981
commit 1c7c645831
2 changed files with 22 additions and 12 deletions

View File

@ -34,33 +34,39 @@
'title' => 'OGV stream URL', 'title' => 'OGV stream URL',
'name' => 'ogvurl', 'name' => 'ogvurl',
'type' => 'text', 'type' => 'text',
'default' => 'https://lainchan.org/radio_assets/lainstream.ogg') 'default' => 'https://lainchan.org/radio_assets/lainstream.ogg'
); );
$theme['config'][] = Array( $theme['config'][] = Array(
'title' => 'RTMP stream URL', 'title' => 'RTMP stream URL',
'name' => 'rtmpurl', 'name' => 'rtmpurl',
'type' => 'text', 'type' => 'text',
'default' => 'rtmp://lainchan.org/live/&stream') 'default' => 'rtmp://lainchan.org/live/stream'
);
$theme['config'][] = Array(
'title' => 'RTMP Video.JS stream URL',
'name' => 'rtmpvideojsurl',
'type' => 'text',
'default' => 'rtmp://lainchan.org/live/&stream'
); );
$theme['config'][] = Array( $theme['config'][] = Array(
'title' => 'OGV Status URL', 'title' => 'OGV Status URL',
'name' => 'ogvstatus', 'name' => 'ogvstatus',
'type' => 'text', 'type' => 'text',
'default' => '/radio_assets/status.xsl') 'default' => '/radio_assets/status.xsl'
); );
$theme['config'][] = Array( $theme['config'][] = Array(
'title' => 'RTMP Status URL', 'title' => 'RTMP Status URL',
'name' => 'rtmpstatus', 'name' => 'rtmpstatus',
'type' => 'text', 'type' => 'text',
'default' => '/live/status?app=live&name=stream') 'default' => '/live/status?app=live&name=stream'
); );
$theme['config'][] = Array( $theme['config'][] = Array(
'title' => 'RTMP Viewers URL', 'title' => 'RTMP Viewers URL',
'name' => 'rtmpviewers', 'name' => 'rtmpviewers',
'type' => 'text', 'type' => 'text',
'default' => '/live/subs?app=live&name=stream') 'default' => '/live/subs?app=live&name=stream'
); );

View File

@ -12,6 +12,9 @@
<link rel="stylesheet" media="screen" href="/stylesheets/dark.css"> <link rel="stylesheet" media="screen" href="/stylesheets/dark.css">
<!--{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}--> <!--{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}-->
{% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %} {% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
<style>
.video-js { width:100%!important; height: auto!important; }
</style>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
@ -21,7 +24,7 @@ $(document).ready(function(){
}); });
function check_status(){ function check_status(){
$.get("{ settings.rtmpviewers }}", function(data){ $.get("{{ settings.rtmpviewers }}", function(data){
$("#rtmpviewers").text(data); $("#rtmpviewers").text(data);
}); });
@ -47,16 +50,17 @@ $("#ogvviewers").text( sd[22].textContent );
<div class="subtitle">{{ settings.subtitle }}</div> <div class="subtitle">{{ settings.subtitle }}</div>
</header> </header>
<div class="ban"> <div>
<video id="my-video" class="video-js vjs-big-play-centered vjs-default-skin" controls preload="auto" width="640" height="264" poster="https://lainchan.org/static/lain_is_cute_datass_small.png" data-setup="{}"> <div id="box" width="100%">
<source src='{{ setings.rtmpurl }}' type='rtmp/mp4'/> <video id="my-video" class="video-js vjs-big-play-centered vjs-default-skin" height="264" width="640" controls preload="auto" poster="https://lainchan.org/static/lain_is_cute_datass_small.png" data-setup='{ "example_option": true, "techOrder": ["html5","flash"],"fluid": true}'>
<source src='{{ settings.rtmpvideojsurl }}' type='rtmp/mp4'/>
<source src="{{ settings.ogvurl }}" type='video/ogv'> <source src="{{ settings.ogvurl }}" type='video/ogv'>
<p class="vjs-no-js"> <p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p> </p>
</video> </video>
</div>
<br/> <br/>
<p>Now Streaming RTMP <span id="rtmpnowplaying">unknown</span></p> <p>Now Streaming RTMP <span id="rtmpnowplaying">unknown</span></p>
<p>Now Streaming OGV <span id="ogvnowplaying">unknown</span></p> <p>Now Streaming OGV <span id="ogvnowplaying">unknown</span></p>
@ -64,8 +68,8 @@ $("#ogvviewers").text( sd[22].textContent );
<p>Current OGV viewers: <span id="ogvviewers">unknown</span></p> <p>Current OGV viewers: <span id="ogvviewers">unknown</span></p>
<div> <div>
<p>Raw stream URLs for Mplayer, mpv, VLC, etc:</p> <p>Raw stream URLs for Mplayer, mpv, VLC, etc:</p>
<p> RTMP : {{ setings.rtmpurl }} </p> <p> RTMP : {{ settings.rtmpurl }} </p>
<p> OGV : {{ setings.ogvurl }} </p> <p> OGV : {{ settings.ogvurl }} </p>
</div><br/> </div><br/>
</div> </div>