summaryrefslogtreecommitdiff
path: root/templates/themes/stream
diff options
context:
space:
mode:
authorAppleman1234 <applemansigloo@gmail.com>2016-12-15 18:25:42 +0900
committerGitHub <noreply@github.com>2016-12-15 18:25:42 +0900
commitcae526e65a20f3da2d8884c4d8e8978c54120000 (patch)
tree2954153dd49f616f5018490058ff4bfbd17300d3 /templates/themes/stream
parentb58fab98147a92c8e6d22f15d23684508b6bb811 (diff)
parent5feae402cb55d49963bfd2c6f5a33d10690ecbc1 (diff)
Merge pull request #79 from lainchan/clean_prod_vichan_update
Merge vichan changes from upstream and changes directly applied to the site.
Diffstat (limited to 'templates/themes/stream')
-rw-r--r--templates/themes/stream/info.php80
-rw-r--r--templates/themes/stream/stream.html88
-rw-r--r--templates/themes/stream/theme.php34
-rw-r--r--templates/themes/stream/thumb.pngbin0 -> 7872 bytes
4 files changed, 202 insertions, 0 deletions
diff --git a/templates/themes/stream/info.php b/templates/themes/stream/info.php
new file mode 100644
index 00000000..081b29ca
--- /dev/null
+++ b/templates/themes/stream/info.php
@@ -0,0 +1,80 @@
+<?php
+ $theme = Array();
+
+ // Theme name
+ $theme['name'] = 'Stream';
+ // Description (you can use Tinyboard markup here)
+ $theme['description'] = 'Stream page';
+ $theme['version'] = 'v0.9.1';
+
+ // Theme configuration
+ $theme['config'] = Array();
+
+ $theme['config'][] = Array(
+ 'title' => 'Site title',
+ 'name' => 'title',
+ 'type' => 'text'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Slogan',
+ 'name' => 'subtitle',
+ 'type' => 'text',
+ 'comment' => '(optional)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'File',
+ 'name' => 'file',
+ 'type' => 'text',
+ 'default' => 'stream.html',
+ 'comment' => '(eg. "stream.html")'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'OGV stream URL',
+ 'name' => 'ogvurl',
+ 'type' => 'text',
+ 'default' => 'https://lainchan.org/radio_assets/lainstream.ogg'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'RTMP stream URL',
+ 'name' => 'rtmpurl',
+ 'type' => 'text',
+ '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(
+ 'title' => 'OGV Status URL',
+ 'name' => 'ogvstatus',
+ 'type' => 'text',
+ 'default' => '/radio_assets/status.xsl'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'RTMP Status URL',
+ 'name' => 'rtmpstatus',
+ 'type' => 'text',
+ 'default' => '/live/status?app=live&name=stream'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'RTMP Viewers URL',
+ 'name' => 'rtmpviewers',
+ 'type' => 'text',
+ 'default' => '/live/subs?app=live&name=stream'
+ );
+
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'stream_build';
+ $theme['install_callback'] = 'stream_install';
+ if (!function_exists('stream_install')) {
+ function stream_install($settings) {
+ }
+ }
+
diff --git a/templates/themes/stream/stream.html b/templates/themes/stream/stream.html
new file mode 100644
index 00000000..dc2ed26d
--- /dev/null
+++ b/templates/themes/stream/stream.html
@@ -0,0 +1,88 @@
+{% filter remove_whitespace %}
+<!doctype html>
+<html>
+<head>
+ <link rel="stylesheet" media="screen" href="/stylesheets/style.css">
+ <link href="https://vjs.zencdn.net/5.11.7/video-js.css" rel="stylesheet">
+ <meta charset="utf-8">
+ <title>{{ settings.title }}</title>
+ {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
+ {% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %}
+ <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.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 type="text/javascript">
+$(document).ready(function(){
+ check_status();
+ setInterval(check_status, 15000);
+});
+
+function check_status(){
+ $.get("{{ settings.rtmpviewers }}", function(data){
+ $("#rtmpviewers").text(data);
+ });
+
+ $.get("{{ settings.ogvstatus }}", function(data){
+var el = $( '<div></div>' );
+el.html(data);
+var sd = el.find(".streamdata");
+
+$("#ogvnowplaying").text( sd[25].textContent);
+
+$("#ogvviewers").text( sd[22].textContent );
+});
+}
+
+</script>
+</head>
+<body>
+ <div class="bar top">
+ {{ boardlist.top }}
+ </div>
+ <header>
+ <h1>{{ settings.title }}</h1>
+ <div class="subtitle">{{ settings.subtitle }}</div>
+ </header>
+
+ <div>
+ <div id="box" width="100%">
+ <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'>
+ <p class="vjs-no-js">
+ 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>
+ </p>
+ </video>
+ </div>
+ <br/>
+ <p>Now Streaming RTMP <span id="rtmpnowplaying">unknown</span></p>
+ <p>Now Streaming OGV <span id="ogvnowplaying">unknown</span></p>
+ <p>Current RTMP viewers: <span id="rtmpviewers">unknown</span></p>
+ <p>Current OGV viewers: <span id="ogvviewers">unknown</span></p>
+ <div>
+ <p>Raw stream URLs for Mplayer, mpv, VLC, etc:</p>
+ <p> RTMP : {{ settings.rtmpurl }} </p>
+ <p> OGV : {{ settings.ogvurl }} </p>
+ </div><br/>
+ </div>
+
+ </div>
+
+ <hr/>
+ <footer>
+ <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
+ <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -
+ <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
+ </footer>
+<script src="https://vjs.zencdn.net/5.11.7/video.js"></script>
+</body>
+</html>
+{% endfilter %}
diff --git a/templates/themes/stream/theme.php b/templates/themes/stream/theme.php
new file mode 100644
index 00000000..6d11a0dc
--- /dev/null
+++ b/templates/themes/stream/theme.php
@@ -0,0 +1,34 @@
+<?php
+ require 'info.php';
+
+ function stream_build($action, $settings, $board) {
+ // Possible values for $action:
+ // - all (rebuild everything, initialization)
+ // - boards (board list changed)
+
+ Stream::build($action, $settings);
+ }
+
+ // Wrap functions in a class so they don't interfere with normal Tinyboard operations
+ class Stream {
+ public static function build($action, $settings) {
+ global $config;
+
+ if ($action == 'all' )
+ file_write($config['dir']['home'] . $settings['file'], Stream::homepage($settings));
+ }
+
+ // Build news page
+ public static function homepage($settings) {
+ global $config;
+
+
+ return Element('themes/stream/stream.html', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'boardlist' => createBoardlist(),
+ ));
+ }
+ };
+
+?>
diff --git a/templates/themes/stream/thumb.png b/templates/themes/stream/thumb.png
new file mode 100644
index 00000000..d0c3c771
--- /dev/null
+++ b/templates/themes/stream/thumb.png
Binary files differ