2016-10-08 02:29:06 -04:00
<!doctype html>
< html >
< head >
< link rel = "stylesheet" media = "screen" href = "/stylesheets/style.css" >
2017-03-03 01:48:53 -05:00
< link href = "https://vjs.zencdn.net/5.16.0/video-js.css" rel = "stylesheet" >
2016-10-08 02:29:06 -04:00
< meta charset = "utf-8" >
2017-03-03 01:48:53 -05:00
< meta name = "viewport" content = "width=device-width,initial-scale=1.0" >
2016-10-08 02:29:06 -04:00
< title > {{ settings.title }}< / title >
2017-04-30 00:12:05 -04:00
< script type = "text/javascript" >
var active_page = "stream";
< / script >
{% include 'header.html' %}
2016-12-10 04:18:27 -05:00
< style >
.video-js { width:100%!important; height: auto!important; }
< / style >
2016-10-08 02:29:06 -04:00
< script src = "https://code.jquery.com/jquery-2.1.3.min.js" > < / script >
2017-04-30 00:12:05 -04:00
< script src = "https://vjs.zencdn.net/5.16.0/video.js" > < / script >
< script src = "js/videojs-contrib-hls.js" > < / script >
2016-10-08 02:29:06 -04:00
< script type = "text/javascript" >
$(document).ready(function(){
check_status();
2017-05-04 00:48:09 -04:00
$('#format').trigger('change');
2016-10-08 02:29:06 -04:00
setInterval(check_status, 15000);
});
function check_status(){
2016-12-10 04:18:27 -05:00
$.get("{{ settings.rtmpviewers }}", function(data){
2016-10-08 02:29:06 -04:00
$("#rtmpviewers").text(data);
});
$.get("{{ settings.ogvstatus }}", function(data){
var el = $( '< div > < / div > ' );
2017-04-30 00:12:05 -04:00
el.html(data.getElementsByTagName('html')[0].innerHTML);
2016-10-08 02:29:06 -04:00
var sd = el.find(".streamdata");
2017-03-03 01:48:53 -05:00
if (typeof sd !== 'undefined') {
if (typeof sd[25] !== 'undefined') {
$("#ogvnowplaying").text( sd[25].textContent);
}
if (typeof sd[22] !== 'undefined') {
$("#ogvviewers").text( sd[22].textContent );
}
}
2016-10-08 02:29:06 -04:00
});
}
2017-05-04 00:48:09 -04:00
2017-04-30 00:12:05 -04:00
function change_format(e) {
$(document).ready(function(){
2017-05-04 00:48:09 -04:00
let media = document.getElementById("my-video");
2017-04-30 00:12:05 -04:00
let paused = media.paused;
format = e.value;
2017-05-04 00:48:09 -04:00
var datasetup;
if(videojs.getPlayers()["my-video"]) {
delete videojs.getPlayers()["my-video"];
}
2017-04-30 00:12:05 -04:00
if (format === "hls"){
2017-05-04 00:48:09 -04:00
datasetup = {"example_option": true, "techOrder": ["html5","flash"],"fluid": true };
2017-04-30 00:12:05 -04:00
}
else if (format === "ogg"){
2017-05-04 00:48:09 -04:00
datasetup = {"example_option": true, "techOrder": ["html5","flash"],"fluid": true };
2017-04-30 00:12:05 -04:00
}
else if (format === "rtmp"){
2017-05-04 00:48:09 -04:00
datasetup = {"example_option": true, "techOrder": ["flash"],"fluid": true };
2017-04-30 00:12:05 -04:00
}
2017-05-04 00:48:09 -04:00
var myvideo = videojs("my-video", datasetup , function(){
console.log("loaded");
});
var myvideo;
if (format === "hls"){
myvideo = $("#my-video_html5_api");
myvideo.src ="{{ settings.hlsurl }}";
myvideo.src.type = "application/vnd.apple.mpegurl";
}
else if (format === "ogg"){
myvideo = $("#my-video_html5_api");
myvideo.src = "{{ settings.ogvurl }}";
myvideo.src.type = "video/ogg";
}
else if (format === "rtmp"){
myvideo = $("#my-video");
myvideo.src = "{{ settings.rtmpvideojsurl }}";
myvideo.src.type = "rtmp/mp4";
}
myvideo.load();
if(!paused) {
myvideo.play();
}
2017-04-30 00:12:05 -04:00
check_status();
});
}
2016-10-08 02:29:06 -04:00
< / script >
< / head >
< body >
< div class = "bar top" >
{{ boardlist.top }}
< / div >
< header >
2017-05-11 08:05:20 -04:00
< h1 class = "glitch" data-text = "{{ settings.title }}" > {{ settings.title }}< / h1 >
2016-10-08 02:29:06 -04:00
< div class = "subtitle" > {{ settings.subtitle }}< / div >
< / header >
2016-12-10 04:18:27 -05:00
< div >
2017-04-30 00:12:05 -04:00
<!-- data - setup='{ "example_option": true, "techOrder": ["html5","flash"],"fluid": true} -->
2016-12-10 04:18:27 -05:00
< div id = "box" width = "100%" >
2017-05-04 00:48:09 -04:00
< 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" >
2017-04-30 00:12:05 -04:00
{% set formatlist = settings.formats|split(' ') %}
{% for format in formatlist %}
{% if format == "hls" %}
2017-05-04 00:48:09 -04:00
< source id = "hlssource" src = "{{ settings.hlsurl }}" type = "application/vnd.apple.mpegurl" >
2017-04-30 00:12:05 -04:00
{% elseif format == "ogg" %}
< source id = "oggsource" src = "{{ settings.ogvurl }}" type = "video/ogg" >
{% elseif format == "rtmp" %}
< source id = "rtmpsource" src = "{{ settings.rtmpvideojsurl }}" type = "rtmp/mp4" >
{% endif %}
{% endfor %}
2016-10-08 02:29:06 -04:00
< 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 >
2016-12-10 04:18:27 -05:00
< / div >
2016-10-08 02:29:06 -04:00
< br / >
2017-04-30 00:12:05 -04:00
< p class = "inlineheading" style = "text-align:center;" > FORMAT:
< select style = "float:none;" id = "format" onchange = "change_format(this)" >
{% set formatlist = settings.formats|split(' ') %}
{% for format in formatlist %}
{% if format == settings.defaultformat %}
< option value = "{{ format }}" selected > {{ format }}< / option >
{% else %}
< option value = "{{ format }}" > {{ format }}< / option >
{% endif %}
{% endfor %}
< / select > < / p >
< br / >
2016-10-08 02:29:06 -04:00
< 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 >
2017-04-30 00:12:05 -04:00
< p > Raw stream URLs for Mplayer, mpv, VLC, browser etc:< / p >
< p > HLS: {{ settings.hlsurl }} < / p >
2016-12-10 04:18:27 -05:00
< p > RTMP : {{ settings.rtmpurl }} < / p >
< p > OGV : {{ settings.ogvurl }} < / p >
2017-03-03 01:48:53 -05:00
< p > I want to stream. How do I stream ?< / p >
< p > Get the stream key. (Ask on IRC #lainstream on lainchan IRC). Be prepared to answer questions on, what stream you want RTMP, OGV, what you are streaming, why you are streaming it and when you are streaming it ?< / p >
< p > For RTMP < / p >
< p > Use obs or ffmpeg to stream < / p >
< p > E.g. ffmpeg -re -i filename -c copy -f flv {{ settings.rtmpurl }}?key=KEYGOESHERE< / p >
2017-04-30 00:12:05 -04:00
< p > obs url field: rtmp://lainchan.org/show/ < / p >
< p > obs key field: stream?user=< USER > & pass=< PASSWORD > < / p >
< p > For OGV Icecast cat filename | oggfwd -p lainchan.org 8000 < PASSWORD > /lainstream.ogg < / p >
2016-10-08 02:29:06 -04:00
< / 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 © 2010-2014 Tinyboard Development Group
< br > < a href = "https://engine.vichan.net/" > vichan< / a > Copyright © 2012-2015 vichan-devel< / p >
< / footer >
2017-04-30 00:12:05 -04:00
< div class = "pages" > < / div >
< script type = "text/javascript" > { % r a w % }
ready();
{% endraw %}< / script >
2016-10-08 02:29:06 -04:00
< / body >
< / html >