diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2016-03-29 22:52:00 +0200 |
---|---|---|
committer | root <root@wat.gathering.org> | 2016-03-29 22:53:01 +0200 |
commit | cce81188954a0ba1417e0d5ea267d0e1f8783164 (patch) | |
tree | c2ca911431c77c12b6003567c186dbfc62c2af88 | |
parent | c3cfa21acad31c22841bfcb22a6618050b39354c (diff) |
Stream-changes for TG16 + minor cleanups.
-rw-r--r-- | examples/tg16/netlist.txt | 193 | ||||
-rw-r--r-- | examples/tg16/patchlist.txt (renamed from patchlist.txt) | 0 | ||||
-rw-r--r-- | examples/tg16/switches.txt (renamed from switches.txt) | 0 | ||||
-rw-r--r-- | web/etc/nginx/default.conf | 10 | ||||
-rwxr-xr-x | web/stream.gathering.org/embed.pl | 90 | ||||
-rw-r--r-- | web/stream.gathering.org/embed.tmpl | 92 | ||||
-rw-r--r-- | web/stream.gathering.org/event.vlc | 3 | ||||
-rwxr-xr-x | web/stream.gathering.org/generate_vlc.pl | 4 | ||||
-rwxr-xr-x | web/stream.gathering.org/index.pl | 41 | ||||
-rw-r--r-- | web/stream.gathering.org/index.tmpl | 111 | ||||
-rw-r--r-- | web/stream.gathering.org/noccam.vlc | 3 | ||||
-rw-r--r-- | web/stream.gathering.org/resources/css/core.css | 30 | ||||
-rw-r--r-- | web/stream.gathering.org/southcam.vlc | 3 | ||||
-rw-r--r-- | web/stream.gathering.org/streamlib/stream/config.pm | 128 |
14 files changed, 537 insertions, 171 deletions
diff --git a/examples/tg16/netlist.txt b/examples/tg16/netlist.txt new file mode 100644 index 0000000..0ef311c --- /dev/null +++ b/examples/tg16/netlist.txt @@ -0,0 +1,193 @@ +# Manual networks +185.110.150.0/25 2a06:5841:150a::/64 noc +185.110.151.0/27 2a06:5841:151a::/64 tech-wlan + + + + +88.92.59.0/24 2a06:5840:59::/64 logistikk +88.92.60.0/24 2a06:5840:60::/64 event +88.92.61.0/24 2a06:5840:61::/64 creativia +88.92.62.0/24 2a06:5840:62::/64 event +88.92.63.0/24 2a06:5840:63::/64 info +88.92.64.0/24 2a06:5840:64::/64 north +88.92.65.0/24 2a06:5840:65::/64 fugleberget +88.92.66.0/24 2a06:5840:66::/64 crew +88.92.67.0/24 2a06:5840:67::/64 stage +88.92.68.0/24 2a06:5840:68::/64 foh +88.92.69.0/24 2a06:5840:69::/64 innsjekk +88.92.70.0/24 2a06:5840:70::/64 resepsjon +88.92.71.0/24 2a06:5840:71::/64 medic +88.92.72.0/24 2a06:5840:72::/64 sponsor +88.92.73.0/24 2a06:5840:73::/64 presse +88.92.74.0/24 2a06:5840:74::/64 security +88.92.75.0/24 2a06:5840:75::/64 security2 +88.92.76.0/24 2a06:5840:76::/64 game +88.92.77.0/24 2a06:5840:77::/64 auditorium +88.92.78.0/24 2a06:5840:78::/64 gamestage +88.92.79.0/24 2a06:5840:79::/64 hon +88.92.81.0/26 2a06:5840:81a::/64 highlights +88.92.93.0/24 2a06:5840:93::/64 santander-temp +88.92.95.0/25 2a06:5840:95a::/64 deltaker-srv + + +88.92.96.0/19 2a06:5840:96::/64 wlan +88.92.53.0/29 2a06:5840:530::/64 ap-stand +88.92.51.0/26 2a06:5840:51a::/64 ap-distro0 +88.92.51.64/26 2a06:5840:51b::/64 ap-distro1 +88.92.51.128/26 2a06:5840:51c::/64 ap-distro2 +88.92.51.192/26 2a06:5840:51d::/64 ap-distro3 +88.92.52.0/26 2a06:5840:52a::/64 ap-distro4 +88.92.52.64/26 2a06:5840:52b::/64 ap-distro5 +88.92.52.128/26 2a06:5840:52c::/64 ap-distro6 +88.92.52.192/26 2a06:5840:52d::/64 ap-distro7 + +88.92.41.64/26 2a06:5840:41b::/64 flankenord +88.92.41.128/26 2a06:5840:41c::/64 flankesor +88.92.41.192/26 2a06:5840:41d::/64 streamer1 + + +88.92.40.0/26 2a06:5840:40a::/64 creativia1 +88.92.40.64/26 2a06:5840:40b::/64 creativia2 +88.92.40.128/26 2a06:5840:40c::/64 creativia3 +88.92.40.192/26 2a06:5840:40d::/64 creativia4 +88.92.41.0/26 2a06:5840:41a::/64 creativia5 +88.92.42.64/26 2a06:5840:42b::/64 creativia6 +88.92.42.128/26 2a06:5840:42c::/64 creativia7 +88.92.42.192/26 2a06:5840:42d::/64 creativia-village +88.92.53.64/26 2a06:5840:53b::/64 ap-creativia +88.92.43.0/26 2a06:5840:43a::/64 creativiasw1 + + +# From switches.txt +88.92.0.0/26 2a06:5840:0a::/64 e1-3 +88.92.0.64/26 2a06:5840:0b::/64 e1-4 +88.92.0.128/26 2a06:5840:0c::/64 e3-3 +88.92.0.192/26 2a06:5840:0d::/64 e3-4 +88.92.1.0/26 2a06:5840:1a::/64 e5-2 +88.92.1.64/26 2a06:5840:1b::/64 e5-3 +88.92.1.128/26 2a06:5840:1c::/64 e5-4 +88.92.1.192/26 2a06:5840:1d::/64 e7-1 +88.92.2.0/26 2a06:5840:2a::/64 e7-2 +88.92.2.64/26 2a06:5840:2b::/64 e7-3 +88.92.2.128/26 2a06:5840:2c::/64 e7-4 +88.92.2.192/26 2a06:5840:2d::/64 e9-1 +88.92.3.0/26 2a06:5840:3a::/64 e9-2 +88.92.3.64/26 2a06:5840:3b::/64 e9-3 +88.92.3.128/26 2a06:5840:3c::/64 e9-4 +88.92.3.192/26 2a06:5840:3d::/64 e11-1 +88.92.4.0/26 2a06:5840:4a::/64 e11-2 +88.92.4.64/26 2a06:5840:4b::/64 e11-3 +88.92.4.128/26 2a06:5840:4c::/64 e11-4 +88.92.4.192/26 2a06:5840:4d::/64 e13-1 +88.92.5.0/26 2a06:5840:5a::/64 e13-2 +88.92.5.64/26 2a06:5840:5b::/64 e13-3 +88.92.5.128/26 2a06:5840:5c::/64 e13-4 +88.92.5.192/26 2a06:5840:5d::/64 e15-1 +88.92.6.0/26 2a06:5840:6a::/64 e15-2 +88.92.6.64/26 2a06:5840:6b::/64 e15-3 +88.92.6.128/26 2a06:5840:6c::/64 e15-4 +88.92.6.192/26 2a06:5840:6d::/64 e17-1 +88.92.7.0/26 2a06:5840:7a::/64 e17-2 +88.92.7.64/26 2a06:5840:7b::/64 e17-3 +88.92.7.128/26 2a06:5840:7c::/64 e17-4 +88.92.7.192/26 2a06:5840:7d::/64 e19-1 +88.92.8.0/26 2a06:5840:8a::/64 e19-2 +88.92.8.64/26 2a06:5840:8b::/64 e19-3 +88.92.8.128/26 2a06:5840:8c::/64 e19-4 +88.92.8.192/26 2a06:5840:8d::/64 e21-1 +88.92.9.0/26 2a06:5840:9a::/64 e21-2 +88.92.9.64/26 2a06:5840:9b::/64 e21-3 +88.92.9.128/26 2a06:5840:9c::/64 e21-4 +88.92.9.192/26 2a06:5840:9d::/64 e23-1 +88.92.10.0/26 2a06:5840:10a::/64 e23-2 +88.92.10.64/26 2a06:5840:10b::/64 e23-3 +88.92.10.128/26 2a06:5840:10c::/64 e23-4 +88.92.10.192/26 2a06:5840:10d::/64 e25-1 +88.92.11.0/26 2a06:5840:11a::/64 e25-2 +88.92.11.64/26 2a06:5840:11b::/64 e27-1 +88.92.11.128/26 2a06:5840:11c::/64 e27-2 +88.92.11.192/26 2a06:5840:11d::/64 e29-1 +88.92.12.0/26 2a06:5840:12a::/64 e29-2 +88.92.12.64/26 2a06:5840:12b::/64 e31-1 +88.92.12.128/26 2a06:5840:12c::/64 e31-2 +88.92.12.192/26 2a06:5840:12d::/64 e33-1 +88.92.13.0/26 2a06:5840:13a::/64 e33-2 +88.92.13.64/26 2a06:5840:13b::/64 e35-1 +88.92.13.128/26 2a06:5840:13c::/64 e35-2 +88.92.13.192/26 2a06:5840:13d::/64 e37-1 +88.92.14.0/26 2a06:5840:14a::/64 e37-2 +88.92.14.64/26 2a06:5840:14b::/64 e39-1 +88.92.14.128/26 2a06:5840:14c::/64 e39-2 +88.92.14.192/26 2a06:5840:14d::/64 e41-1 +88.92.15.0/26 2a06:5840:15a::/64 e41-2 +88.92.15.64/26 2a06:5840:15b::/64 e41-3 +88.92.15.128/26 2a06:5840:15c::/64 e41-4 +88.92.15.192/26 2a06:5840:15d::/64 e43-1 +88.92.16.0/26 2a06:5840:16a::/64 e43-2 +88.92.16.64/26 2a06:5840:16b::/64 e43-3 +88.92.16.128/26 2a06:5840:16c::/64 e43-4 +88.92.16.192/26 2a06:5840:16d::/64 e45-1 +88.92.17.0/26 2a06:5840:17a::/64 e45-2 +88.92.17.64/26 2a06:5840:17b::/64 e45-3 +88.92.17.128/26 2a06:5840:17c::/64 e45-4 +88.92.17.192/26 2a06:5840:17d::/64 e47-1 +88.92.18.0/26 2a06:5840:18a::/64 e47-2 +88.92.18.64/26 2a06:5840:18b::/64 e47-3 +88.92.18.128/26 2a06:5840:18c::/64 e47-4 +88.92.18.192/26 2a06:5840:18d::/64 e49-1 +88.92.19.0/26 2a06:5840:19a::/64 e49-2 +88.92.19.64/26 2a06:5840:19b::/64 e49-3 +88.92.19.128/26 2a06:5840:19c::/64 e49-4 +88.92.19.192/26 2a06:5840:19d::/64 e51-1 +88.92.20.0/26 2a06:5840:20a::/64 e51-2 +88.92.20.64/26 2a06:5840:20b::/64 e51-3 +88.92.20.128/26 2a06:5840:20c::/64 e51-4 +88.92.20.192/26 2a06:5840:20d::/64 e53-1 +88.92.21.0/26 2a06:5840:21a::/64 e53-2 +88.92.21.64/26 2a06:5840:21b::/64 e53-3 +88.92.21.128/26 2a06:5840:21c::/64 e53-4 +88.92.21.192/26 2a06:5840:21d::/64 e55-1 +88.92.22.0/26 2a06:5840:22a::/64 e55-2 +88.92.22.64/26 2a06:5840:22b::/64 e55-3 +88.92.22.128/26 2a06:5840:22c::/64 e55-4 +88.92.22.192/26 2a06:5840:22d::/64 e57-1 +88.92.23.0/26 2a06:5840:23a::/64 e57-2 +88.92.23.64/26 2a06:5840:23b::/64 e57-3 +88.92.23.128/26 2a06:5840:23c::/64 e57-4 +88.92.23.192/26 2a06:5840:23d::/64 e59-1 +88.92.24.0/26 2a06:5840:24a::/64 e59-2 +88.92.24.64/26 2a06:5840:24b::/64 e59-3 +88.92.24.128/26 2a06:5840:24c::/64 e59-4 +88.92.24.192/26 2a06:5840:24d::/64 e61-1 +88.92.25.0/26 2a06:5840:25a::/64 e61-2 +88.92.25.64/26 2a06:5840:25b::/64 e61-3 +88.92.25.128/26 2a06:5840:25c::/64 e61-4 +88.92.25.192/26 2a06:5840:25d::/64 e63-1 +88.92.26.0/26 2a06:5840:26a::/64 e63-2 +88.92.26.64/26 2a06:5840:26b::/64 e63-3 +88.92.26.128/26 2a06:5840:26c::/64 e63-4 +88.92.26.192/26 2a06:5840:26d::/64 e65-1 +88.92.27.0/26 2a06:5840:27a::/64 e65-2 +88.92.27.64/26 2a06:5840:27b::/64 e65-3 +88.92.27.128/26 2a06:5840:27c::/64 e65-4 +88.92.27.192/26 2a06:5840:27d::/64 e67-1 +88.92.28.0/26 2a06:5840:28a::/64 e67-2 +88.92.28.64/26 2a06:5840:28b::/64 e67-3 +88.92.28.128/26 2a06:5840:28c::/64 e67-4 +88.92.28.192/26 2a06:5840:28d::/64 e69-1 +88.92.29.0/26 2a06:5840:29a::/64 e69-2 +88.92.29.64/26 2a06:5840:29b::/64 e71-1 +88.92.29.128/26 2a06:5840:29c::/64 e71-2 +88.92.29.192/26 2a06:5840:29d::/64 e73-1 +88.92.30.0/26 2a06:5840:30a::/64 e73-2 +88.92.30.64/26 2a06:5840:30b::/64 e75-1 +88.92.30.128/26 2a06:5840:30c::/64 e75-2 +88.92.30.192/26 2a06:5840:30d::/64 e77-1 +88.92.31.0/26 2a06:5840:31a::/64 e77-2 +88.92.31.64/26 2a06:5840:31b::/64 e79-1 +88.92.31.128/26 2a06:5840:31c::/64 e79-2 +88.92.31.192/26 2a06:5840:31d::/64 e81-1 +88.92.32.0/26 2a06:5840:32a::/64 e81-2 +88.92.32.64/26 2a06:5840:32b::/64 e83-2 +88.92.32.128/26 2a06:5840:32c::/64 e85-2 diff --git a/patchlist.txt b/examples/tg16/patchlist.txt index 5b460b5..5b460b5 100644 --- a/patchlist.txt +++ b/examples/tg16/patchlist.txt diff --git a/switches.txt b/examples/tg16/switches.txt index 67b49f4..67b49f4 100644 --- a/switches.txt +++ b/examples/tg16/switches.txt diff --git a/web/etc/nginx/default.conf b/web/etc/nginx/default.conf index 4335774..80fc4f3 100644 --- a/web/etc/nginx/default.conf +++ b/web/etc/nginx/default.conf @@ -156,8 +156,7 @@ server { ssl_stapling on; ssl_stapling_verify on; root /var/www/stream/; -# index index.pl index.html; - index index.pl index.py index.html; + index index.pl index.html; location /hls { types { #application/vnd.apple.mpegurl m3u8; @@ -192,13 +191,6 @@ server { allow 2a06:5841:151a::/64; deny all; } - location ~ \.py { - try_files $uri =404; - fastcgi_pass unix:/tmp/index-fcgi.sock; - fastcgi_index index.py; - fastcgi_param PATH_INFO $fastcgi_path_info; - include fastcgi_params; - } location ~ \.pl|cgi$ { try_files $uri =404; gzip off; diff --git a/web/stream.gathering.org/embed.pl b/web/stream.gathering.org/embed.pl index 91fc413..ae76bea 100755 --- a/web/stream.gathering.org/embed.pl +++ b/web/stream.gathering.org/embed.pl @@ -1,14 +1,18 @@ -#!/usr/bin/perl -I /root/tgmanage/web/stream.gathering.org/streamlib +#!/usr/bin/perl -I /root/tgmanage/web/stream.gathering.org/streamlib/ use warnings; use strict; use CGI; +# apt-get install libgeo-ip-perl use Geo::IP; use NetAddr::IP; use Net::IP; # apt-get install libnet-ip-perl libnetaddr-ip-perl use HTML::Template; +# apt-get install libhtml-template-perl use stream; use stream::config; +#use MIME::Base64; +use URI::Escape; my $client = CGI->new; @@ -16,6 +20,12 @@ my $v4net = $stream::config::v4net; my $v6net = $stream::config::v6net; my $tg = $stream::config::tg; my $tg_full = $stream::config::tg_full; +my $video_url_mp4; +my $video_url = $stream::config::video_url; +my $video_url_fallback = $stream::config::video_url_fallback; +if($stream::config::video_url_mp4) { +$video_url_mp4 = $stream::config::video_url_mp4; +} my %streams = %stream::config::streams; my $force_unicast = $client->param('forceunicast'); @@ -29,41 +39,67 @@ my $clip = $client->remote_addr(); my $template = HTML::Template->new(filename => 'embed.tmpl'); my $is_local = &is_ip_local($clip, $v4net, $v6net); -my @streams = &html_local_test(); -$template->param(TG => $tg); +#my @streams = &loop_webcams("event"); +#my @camstreams = &loop_webcams("camera"); + +my %input; +for my $key ( $client->param() ) { + $input{$key} = $client->param($key); +} + +#$template->param(TG => $tg); $template->param(TG_FULL => $tg_full); -$template->param(STREAMS => \@streams); +#$template->param(STREAMS => \@streams); +#$template->param(CAMSTREAMS => \@camstreams); $template->param(NOHEADER => $no_header); +if(exists $input{url}) { + my $url = uri_unescape($input{url}); + + if ($url ~~ %streams) { + $template->param(VIDEO_URL_MAIN => $streams{$url}->{main_url}); + $template->param(VIDEO_URL_FALLBACK => $streams{$url}->{fallback_url}); + if($streams{$url}->{mp4_url}) { + $template->param(VIDEO_URL_MP4 => $streams{$url}->{mp4_url}); + } + } + # Check against XS-scripting: + #if (index($decodedUrl, 'cubemap.tg16.gathering.org/') != -1) { + # $template->param(VIDEO_URL => $decodedUrl); + #} elsif (index($decodedUrl, 'stream.tg16.gathering.org/') != -1) { + # $template->param(VIDEO_URL => $decodedUrl); + #} else { + # $template->param(VIDEO_URL => $video_url); + #} +} else { + $template->param(VIDEO_URL_MAIN => $video_url); + $template->param(VIDEO_URL_FALLBACK => $video_url_fallback); + if($video_url_mp4) { + $template->param(VIDEO_URL_MP4 => $video_url_mp4); + } +} print $template->output(); -sub html_local_test() { +sub loop_webcams() { my @s = (); foreach my $name (sort { $streams{$a}->{priority} <=> $streams{$b}->{priority} } keys %streams) { - my $title_link = "http://stream.tg$tg.gathering.org/stream.pl?delivery=%s&stream=${name}&interlaced=%s"; - my $multicast_link = $streams{$name}->{has_multicast} ? "multicast" : "unicast"; - $multicast_link = "unicast" if ($force_unicast == 1 || not $is_local); + if ($streams{$name}->{type} eq $_[0] && $streams{$name}->{online}) { + my $vlc_url = "http://stream.tg$tg.gathering.org/generate_vlc.pl?delivery=%s&stream=${name}&interlaced=%s"; + my $multicast = $streams{$name}->{has_multicast} ? "multicast" : "unicast"; + $multicast = "unicast" if (defined $force_unicast && $force_unicast == 1 || not $is_local); - if ($streams{$name}->{external}) { - $title_link = $streams{$name}->{url}; - } else { - $title_link = sprintf($title_link, $multicast_link, $streams{$name}->{interlaced}); - } - my %hash = ( - 'title_link' => $title_link, - 'title' => $streams{$name}->{title}, - 'quality' => $streams{$name}->{quality}, - 'type' => $streams{$name}->{type}, - ); - if ($multicast_link eq "multicast") { - $hash{'is_multicast'} .= 1; - my $unicast_link = $title_link; - $unicast_link=~s/multicast/unicast/g; - $hash{'unicast_link'} .= $unicast_link; - } - $hash{'description'} .= $streams{$name}->{description} if exists($streams{$name}->{description}); - push(@s, \%hash); + my $vlc_link = sprintf($vlc_url, $multicast, $streams{$name}->{interlaced}); + my $href_link = '<a class="stream-link-content" href="#" onclick="swapVideo(\'' . $name . '\');">'; + my %hash = ( + 'href' => $href_link, + 'title' => $streams{$name}->{title}, + 'quality' => $streams{$name}->{quality}, + 'type' => $streams{$name}->{type}, + 'vlc_link' => $vlc_link, + ); + push(@s, \%hash); + } } return @s; } diff --git a/web/stream.gathering.org/embed.tmpl b/web/stream.gathering.org/embed.tmpl index 6b9581b..ef3e11b 100644 --- a/web/stream.gathering.org/embed.tmpl +++ b/web/stream.gathering.org/embed.tmpl @@ -1,39 +1,53 @@ -<html> -<head> - <title>The Gathering <TMPL_VAR NAME=TG_FULL> Streams</title> - <link rel="stylesheet" type="text/css" href="pre-tg15/style.css" media="all"> - <script type="text/javascript" src="pre-tg15/jwplayer.js"></script> -</head> -<body> - <div id="innhold"> - <TMPL_UNLESS NAME=NOHEADER> - <h1>The Gathering <TMPL_VAR NAME=TG_FULL> Streams</h1> - <embed type="application/x-shockwave-flash" src="pre-tg15/player.swf" - width="800" height="450" style="undefined" id="mplf" name="mplf" quality="high" - allowfullscreen="true" allowscriptaccess="always" wmode="opaque" - stretching="exactfit" - flashvars="stretching=exactfit&file=http://wat.gathering.org:9094/southcam.flv&autostart=true"></embed> - <p> </p> - </TMPL_UNLESS> - - <TMPL_LOOP NAME="STREAMS"> - <div class="stream-link"> - <div class="stream-icon"><img src="img/icon_<TMPL_VAR NAME=QUALITY>.png" /> <img src="img/icon_<TMPL_VAR NAME=TYPE>.png" /> <TMPL_IF NAME=LOCATION><img src="img/icon_<TMPL_VAR NAME=LOCATION>.png"></TMPL_IF></div> - <div class="stream-link-content"> - <a href="<TMPL_VAR NAME=TITLE_LINK>"><TMPL_VAR NAME=TITLE></a><br> - Source: <TMPL_VAR NAME=SOURCE><br> - Delivery: <TMPL_VAR NAME=delivery> <TMPL_IF NAME=IS_MULTICAST>(<a href='<TMPL_VAR NAME=UNICAST_LINK>'>problems? try unicast vlc link here</a>)</TMPL_IF> - - </div> - </div> - </TMPL_LOOP> - </div> - - - <p>Problems with the non game streams? The easiest way to get a hold of us is on IRC (EFNet); Either of ViD or DoXiD should be available if there's too much traffic on #tg to be heard.</p> - <p><a target="_blank" href="http://stream.tg<TMPL_VAR NAME="TG">.gathering.org">http://stream.tg<TMPL_VAR NAME="TG">.gathering.org</a></p> - -</body> -</html> - - +<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>The Gathering <TMPL_VAR NAME=TG_FULL> Streams</title>
+ <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
+ <link href="//vjs.zencdn.net/5.8/video-js.min.css" rel="stylesheet">
+ <script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
+ <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Droid+Sans" />
+ <style>
+
+body {
+ margin: 0;
+}
+
+.video-js {
+ padding-bottom: 55%; /* video dimensions - height/width */
+ height: 100%;
+ width: 100%;
+}
+ </style>
+</head>
+<body>
+<div class="losvideos">
+ <TMPL_UNLESS NAME=NOHEADER>
+ <video id="stream" class="videoframe video-js vjs-default-skin" controls preload="auto" poster="/resources/images/loading.png" data-setup='{ "autoplay" : true }'>
+ <TMPL_IF NAME=VIDEO_URL_MP4><source src="<TMPL_VAR NAME=VIDEO_URL_MP4>" id="videodata" type="video/mp4"></TMPL_IF>
+ <source src="<TMPL_VAR NAME=VIDEO_URL_MAIN>" id="videodata" type="video/flv">
+ <source src="<TMPL_VAR NAME=VIDEO_URL_FALLBACK>" id="videodata" type="application/x-mpegURL">
+ <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>
+ </TMPL_UNLESS>
+</div>
+<script src="//vjs.zencdn.net/5.8/video.js"></script>
+<script src="./resources/js/videojs-contrib-hls.js"></script>
+<script>
+
+var techOrder = ["html5", "flash"];
+if (navigator.userAgent.match(/Trident|Edge/)) {
+ techOrder = ["flash", "html5"];
+}
+
+var player = videojs('stream', {
+ techOrder: techOrder
+});
+player.play();
+</script>
+</body>
+</html>
+
+
diff --git a/web/stream.gathering.org/event.vlc b/web/stream.gathering.org/event.vlc deleted file mode 100644 index a1c2780..0000000 --- a/web/stream.gathering.org/event.vlc +++ /dev/null @@ -1,3 +0,0 @@ -#EXTM3U -#EXTINF:-1,TG15 Unicasted Event HD (720p50 H.264) 6Mbit/s -http://cubemap.tg15.gathering.org/event.ts diff --git a/web/stream.gathering.org/generate_vlc.pl b/web/stream.gathering.org/generate_vlc.pl index 178973d..5252ec4 100755 --- a/web/stream.gathering.org/generate_vlc.pl +++ b/web/stream.gathering.org/generate_vlc.pl @@ -51,8 +51,8 @@ if (exists($streams{$stream})) { } else {
#$port_del = 80;
$extinf .= "Unicasted";
- $url = $base_url;
- $url_path = $streams{$stream}->{url};
+ $url = $base_url;
+ $url_path = $streams{$stream}->{main_url};
if($streams{$stream}->{ts_enabled} eq 1) {
$url_path =~ s/.flv/.ts/;
}
diff --git a/web/stream.gathering.org/index.pl b/web/stream.gathering.org/index.pl index cc83454..9edcc20 100755 --- a/web/stream.gathering.org/index.pl +++ b/web/stream.gathering.org/index.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -I /root/tgmanage/web/stream.gathering.org/streamlib +#!/usr/bin/perl -I /root/tgmanage/web/stream.gathering.org/streamlib/ use warnings; use strict; use CGI; @@ -11,15 +11,20 @@ use HTML::Template; # apt-get install libhtml-template-perl use stream; use stream::config; -use MIME::Base64; +#use MIME::Base64; +use URI::Escape; my $client = CGI->new; - +my $video_url_mp4; my $v4net = $stream::config::v4net; my $v6net = $stream::config::v6net; my $tg = $stream::config::tg; my $tg_full = $stream::config::tg_full; my $video_url = $stream::config::video_url; +my $video_url_fallback = $stream::config::video_url_fallback; +if($stream::config::video_url_mp4) { +$video_url_mp4 = $stream::config::video_url_mp4; +} my %streams = %stream::config::streams; my $force_unicast = $client->param('forceunicast'); @@ -47,16 +52,30 @@ $template->param(STREAMS => \@streams); $template->param(CAMSTREAMS => \@camstreams); $template->param(NOHEADER => $no_header); if(exists $input{url}) { - my $decodedUrl = decode_base64($input{url}); - # Check against XS-scripting: - if (index($decodedUrl, 'cubemap.tg15.gathering.org/') != -1) { - $template->param(VIDEO_URL => $decodedUrl); - } else { - $template->param(VIDEO_URL => $video_url); + my $url = uri_unescape($input{url}); + + if ($url ~~ %streams) { + $template->param(VIDEO_URL_MAIN => $streams{$url}->{main_url}); + $template->param(VIDEO_URL_FALLBACK => $streams{$url}->{fallback_url}); + if($streams{$url}->{mp4_url}) { + $template->param(VIDEO_URL_MP4 => $streams{$url}->{mp4_url}); + } } + # Check against XS-scripting: + #if (index($decodedUrl, 'cubemap.tg16.gathering.org/') != -1) { + # $template->param(VIDEO_URL => $decodedUrl); + #} elsif (index($decodedUrl, 'stream.tg16.gathering.org/') != -1) { + # $template->param(VIDEO_URL => $decodedUrl); + #} else { + # $template->param(VIDEO_URL => $video_url); + #} $template->param(VIDEO_AUTO_PLAY => 'true'); } else { - $template->param(VIDEO_URL => $video_url); + $template->param(VIDEO_URL_MAIN => $video_url); + $template->param(VIDEO_URL_FALLBACK => $video_url_fallback); + if($video_url_mp4) { + $template->param(VIDEO_URL_MP4 => $video_url_mp4); + } $template->param(VIDEO_AUTO_PLAY => 'false'); } print $template->output(); @@ -71,7 +90,7 @@ sub loop_webcams() { $multicast = "unicast" if (defined $force_unicast && $force_unicast == 1 || not $is_local); my $vlc_link = sprintf($vlc_url, $multicast, $streams{$name}->{interlaced}); - my $href_link = '<a class="stream-link-content" href="#" onclick="swapVideo(\'' . $streams{$name}->{url} . '\');">'; + my $href_link = '<a class="stream-link-content" href="#" onclick="swapVideo(\'' . $name . '\');">'; my %hash = ( 'href' => $href_link, diff --git a/web/stream.gathering.org/index.tmpl b/web/stream.gathering.org/index.tmpl index e1e6a2f..eca7070 100644 --- a/web/stream.gathering.org/index.tmpl +++ b/web/stream.gathering.org/index.tmpl @@ -6,15 +6,14 @@ <!-- Mobile specific
---------------------->
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=0.35">
<!-- CSS specifics
-------------------->
- <link rel="stylesheet" href="/resources/css/normalize.css">
- <link rel="stylesheet" href="/resources/css/skeleton.css">
- <link rel="stylesheet" href="/resources/css/core.css">
- <link rel="stylesheet" href="/resources/css/button-styles.css">
- <link rel="stylesheet" href="/resources/css/video-js.css">
+ <link rel="stylesheet" href="./resources/css/normalize.css">
+ <link rel="stylesheet" href="./resources/css/skeleton.css">
+ <link rel="stylesheet" href="./resources/css/core.css">
+ <link rel="stylesheet" href="./resources/css/button-styles.css">
<style type="text/css">
.vjs-big-play-button {
@@ -28,14 +27,13 @@ <!-- JavaScript specifics
---------------------------->
- <script type="text/javascript" src="/resources/js/jwplayer.js"></script>
- <script type="text/javascript" src="/resources/js/video.js"></script>
- <script type="text/javascript" src="/resources/js/video-quality-selector.js"></script>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
+ <link href="//vjs.zencdn.net/5.8/video-js.min.css" rel="stylesheet">
+ <script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script type="text/javascript">
function swapVideo (url) {
- window.location = '/?url=' + window.btoa(url);
+ window.location = '/?url=' + encodeURIComponent(url);//window.btoa(url);
}
var _float = true;
@@ -78,7 +76,7 @@ right: 0px;
width: 531px;
height: 396px;
- background-image: url('/resources/images/pixel-white.png');
+ //background-image: url('/resources/images/floater.svg');
background-size: cover;
}
@@ -94,26 +92,21 @@ }
</style>
+<!-- creative, event och game -->
</head>
<body>
<div id="header">
- <h1>The Gathering <TMPL_VAR NAME=TG_FULL> Streams</h1>
- </div>
- <div id="floater">
-
- </div>
- <div id="bubble">
- <div class="bubble">
- If you hate me, click me!
- </div>
+ <img src="resources/images/thegathering.png" width="400">
</div>
<div class="section">
<div class="container">
<div class="row">
<div class="twelve columns">
<TMPL_UNLESS NAME=NOHEADER>
- <video id="stream" class="videoframe video-js vjs-default-skin" controls preload="auto" poster="/resources/images/loading.png" data-setup='{ "autoplay": <TMPL_VAR NAME=VIDEO_AUTO_PLAY>, "plugins" : { "resolutionSelector" : { "default_res" : "720", "force_typesz" : [ "video/flv" ] } } }'>
- <source src="<TMPL_VAR NAME=VIDEO_URL>" id="videodata" type="video/flv" data-res="720">
+ <video id="stream" class="videoframe video-js vjs-default-skin" controls preload="auto" poster="/resources/images/loading.png" data-setup='{ "autoplay" : <TMPL_VAR NAME=VIDEO_AUTO_PLAY>, "techOrder": ["flash", "html5"]}'>
+ <source src="<TMPL_VAR NAME=VIDEO_URL_MAIN>" id="videodata" type="video/flv" data-res="720">
+ <TMPL_IF NAME=VIDEO_URL_MP4><source src="<TMPL_VAR NAME=VIDEO_URL_MP4>" id="videodata" type="video/mp4" data-res="720"></TMPL_IF>
+ <source src="<TMPL_VAR NAME=VIDEO_URL_FALLBACK>" id="videodata" type="application/x-mpegURL" data-res="720">
<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>
@@ -158,6 +151,80 @@ </div>
</div>
+
+<script src="//vjs.zencdn.net/5.8/video.js"></script>
+<script src="./resources/js/videojs-contrib-hls.js"></script>
+<script>
+
+// GOOGLE CAST
+
+var current_media;
+var session;
+
+function show_castposter() {
+ stop_loader();
+ castposter.style.display = 'block';
+ loader.style.display = 'none';
+ video.style.display = 'none';
+}
+
+function hide_castposter() {
+ castposter.style.display = 'none';
+ loader.style.display = 'none';
+ video.style.display = 'inline';
+}
+
+function stop_casting() {
+ hide_castposter();
+ if (current_media) {
+ var media = current_media;
+ current_media = null;
+ media.stop();
+ }
+ if (session) {
+ session.stop();
+ session = null;
+ }
+}
+
+function cast_current_video() {
+ if (session === undefined || selected_stream === undefined) {
+ return;
+ }
+ var title = streams[selected_stream].name;
+ var url = streams[selected_stream].url;
+ document.getElementById('casttarget').textContent = session.receiver.friendlyName;
+ show_castposter();
+ video.pause();
+ // If we are already casting this, do nothing.
+ if (current_media && current_media.media.contentId === url) {
+ console.log("Already casting " + url + " to " + session.receiver.friendlyName + " (" + current_media.playerState + ")");
+ return;
+ }
+ if (current_media) {
+ current_media = null; // Signal to on_media_status_update.
+ }
+ var media_info = new chrome.cast.media.MediaInfo(url, "video/mp4");
+ media_info.metadata = new chrome.cast.media.GenericMediaMetadata();
+ media_info.metadata.title = global_title; // + ': ' + title;
+ var request = new chrome.cast.media.LoadRequest(media_info);
+ session.loadMedia(request,
+ on_media_discovered.bind(this, 'loadMedia'),
+ on_media_error);
+}
+
+var techOrder = ["html5", "flash"];
+if (navigator.userAgent.match(/Trident|Edge|OPR/)) {
+ console.log("hit!");
+ techOrder = ["flash", "html5"];
+ //var video = document.getElementById('video');
+ //video.src = "http://bleh";
+}
+var player = videojs('stream', {
+ techOrder: techOrder
+});
+player.play();
+</script>
</body>
</html>
diff --git a/web/stream.gathering.org/noccam.vlc b/web/stream.gathering.org/noccam.vlc deleted file mode 100644 index e1bbf42..0000000 --- a/web/stream.gathering.org/noccam.vlc +++ /dev/null @@ -1,3 +0,0 @@ -#EXTM3U -#EXTINF:-1,TG15 Unicasted NOC Webcam HD (720p H.264) 3Mbit/s -http://cubemap.tg15.gathering.org/noccam.flv diff --git a/web/stream.gathering.org/resources/css/core.css b/web/stream.gathering.org/resources/css/core.css index 536cb89..e4bc7c2 100644 --- a/web/stream.gathering.org/resources/css/core.css +++ b/web/stream.gathering.org/resources/css/core.css @@ -1,5 +1,5 @@ body { - background-color: rgb(32, 32, 64); + background-color: rgb(54, 54, 54); color: #FFFFFF; } @@ -65,9 +65,9 @@ body { padding-top: 150px; } -.videoframe { - left: 50%; -} +/*.videoframe {*/ +/* left: 50%;*/ +/*}*/ .section { padding: 8rem 0 7rem; @@ -100,6 +100,10 @@ body { border: 1px solid #000000; } +.vjs-poster { + background-size: cover !important; +} + .footer { text-align: center; padding-top: 50px; @@ -164,11 +168,11 @@ body { min-width: 320px; min-height: 183px; } - .videoframe { + /*.videoframe { margin-left: -160px; - } - .videoframe:-webkit-full-screen { margin-left: 0px; } - .videoframe:-moz-full-screen { margin-left: 0px; } + }*/ + /*.videoframe:-webkit-full-screen { margin-left: 0px; } + .videoframe:-moz-full-screen { margin-left: 0px; }*/ } /* Bigger than 920 */ @@ -188,11 +192,13 @@ body { min-width: 500px; min-height: 280px; } + /* .videoframe { - margin-left: -250px; + margin-left: -490px; } .videoframe:-webkit-full-screen { margin-left: 0px; } .videoframe:-moz-full-screen { margin-left: 0px; } +*/ } /* Bigger than 1200 */ @@ -210,11 +216,13 @@ body { min-width: 700px; min-height: 393px; } +/* .videoframe { margin-left: -350px; } .videoframe:-webkit-full-screen { margin-left: 0px; } .videoframe:-moz-full-screen { margin-left: 0px; } +*/ } /* Bigger than 1600 */ @@ -234,9 +242,11 @@ body { height: 540px; min-height: 540px; } +/* .videoframe { margin-left: -480px; } .videoframe:-webkit-full-screen { margin-left: 0px; } .videoframe:-moz-full-screen { margin-left: 0px; } -}
\ No newline at end of file +*/ +} diff --git a/web/stream.gathering.org/southcam.vlc b/web/stream.gathering.org/southcam.vlc deleted file mode 100644 index e20970c..0000000 --- a/web/stream.gathering.org/southcam.vlc +++ /dev/null @@ -1,3 +0,0 @@ -#EXTM3U -#EXTINF:-1,TG15 Unicasted South Webcam HD (720p H.264) 3Mbit/s -http://cubemap.tg15.gathering.org/southcam.flv diff --git a/web/stream.gathering.org/streamlib/stream/config.pm b/web/stream.gathering.org/streamlib/stream/config.pm index 1c968da..c07d783 100644 --- a/web/stream.gathering.org/streamlib/stream/config.pm +++ b/web/stream.gathering.org/streamlib/stream/config.pm @@ -6,9 +6,11 @@ use NetAddr::IP; our $v4net = NetAddr::IP->new("151.216.128.0/17"); our $v6net = NetAddr::IP->new("2a02:ed02::/32"); our $multicast = "udp://\@233.191.12.1"; -our $video_url = "http://cubemap.tg15.gathering.org/creativia.flv"; -our $tg = 15; -our $tg_full = 2015; +our $video_url = "http://cubemap.tg16.gathering.org/event.flv"; +our $video_url_mp4 = "http://cubemap.tg16.gathering.org/event.mp4"; +our $video_url_fallback = "http://stream.tg16.gathering.org/hls/event.m3u8"; +our $tg = 16; +our $tg_full = 2016; # priority = sorting order in streaming list @@ -23,7 +25,7 @@ our %streams = ( 'quality' => 'hd', 'priority' => 20, 'port' => 80, - 'url' => 'http://cubemap.tg15.gathering.org/event.flv', + 'main_url' => 'http://cubemap.tg15.gathering.org/event.flv', 'ts_enabled' => 1, 'online' => 0, 'external' => 1, @@ -38,9 +40,9 @@ our %streams = ( 'quality' => 'hd', 'priority' => 100, 'port' => 80, - 'url' => 'http://cubemap.tg15.gathering.org/creativia.flv', + 'main_url' => 'http://cubemap.tg15.gathering.org/creativia.flv', 'ts_enabled' => 1, - 'online' => 1, + 'online' => 0, 'external' => 1, 'interlaced' => 0, 'has_multicast' => 0, @@ -53,7 +55,7 @@ our %streams = ( 'quality' => 'hd', 'priority' => 110, 'port' => 80, - 'url' => 'http://cubemap.tg15.gathering.org/game.flv', + 'main_url' => 'http://cubemap.tg15.gathering.org/game.flv', 'ts_enabled' => 1, 'online' => 0, 'external' => 1, @@ -63,26 +65,13 @@ our %streams = ( 'source' => 'Event', 'title' => 'Game HD (720p50 H.264) 6Mbit/s' }, - -# 'creativia-hd' => { -# 'type' => 'event', -# 'quality' => 'hd', -# 'priority' => 150, -# 'port' => 5004, -# 'url' => '/creativia-lounge.ts', -# 'interlaced' => 0, -# 'has_multicast' => 0, -# 'multicast_ip' => 'udp://@[ff7e:a40:2a02:ed02:ffff::15]:2015', -# 'source' => 'Tech', -# 'title' => 'Creativia Lounge HD (720p50)' -# }, 'event-sd' => { 'type' => 'event', 'quality' => 'sd', 'priority' => 24, 'port' => 80, 'online' => 0, - 'url' => '/event-sd.ts', + 'main_url' => '/event-sd.ts', 'interlaced' => 0, 'has_multicast' => 0, 'multicast_ip' => 'udp://@[ff7e:a40:2a02:ed02:ffff::14]', @@ -95,7 +84,7 @@ our %streams = ( 'priority' => 25, 'port' => 80, 'online' => 0, - 'url' => '/event-superlow.ts', + 'main_url' => '/event-superlow.ts', 'interlaced' => 0, 'has_multicast' => 0, 'multicast_ip' => 'udp://@[ff7e:a40:2a02:ed02:ffff::16]', @@ -108,56 +97,111 @@ our %streams = ( # 'priority' => 25, # 'interlaced' => 0, # 'external' => 1, -# 'url' => 'http://www.gathering.org/tg13/no/live-tv/', +# 'main_url' => 'http://www.gathering.org/tg13/no/live-tv/', # 'source' => 'Event', # 'title' => 'Event SD (gathering.org flash player)', # }, - 'south-raw' => { + 'roofcam-raw' => { 'type' => 'camera', 'quality' => 'hd', - 'priority' => 40, - 'url' => "http://cubemap.tg15.gathering.org/southcam.flv", # <-- In use (Need to rebuild row 67 in index.pl) + 'priority' => 118, + 'main_url' => "/roofcam.ts", 'port' => 80, 'ts_enabled' => 0, - 'interlaced' => 0, + 'interlaced' => 1, + 'online' => 0, 'has_multicast' => 0, - 'external' => 1, # <-- In use (Need to rebuild row 67 in index.pl) - 'online' => 1, -# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]", + #'multicast_ip' => "udp://\@[ff7e:a40:2a02:ed02:ffff::15]", 'source' => 'Tech', - 'title' => "Webcam South (HD) (720p H.264) 3Mbit/s", + 'title' => 'Webcam Roof (HD) (1536x1536 H.264) 8mbps', }, - 'roofcam-raw' => { + 'south-raw' => { 'type' => 'camera', 'quality' => 'hd', - 'priority' => 118, - 'url' => "/roofcam.ts", + 'priority' => 40, + 'main_url' => "http://cubemap.tg16.gathering.org/southcam.flv", # <-- In use (Need to rebuild row 67 in index.pl) + 'fallback_url' => 'http://stream.tg16.gathering.org/hls/southcam.m3u8', 'port' => 80, - 'ts_enabled' => 0, - 'interlaced' => 1, - 'online' => 0, + 'ts_enabled' => 1, + 'interlaced' => 0, 'has_multicast' => 0, - #'multicast_ip' => "udp://\@[ff7e:a40:2a02:ed02:ffff::15]", + 'external' => 1, # <-- In use (Need to rebuild row 67 in index.pl) + 'online' => 1, +# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]", 'source' => 'Tech', - 'title' => 'Webcam Roof (HD) (1536x1536 H.264) 8mbps', + 'title' => "Webcam South (720p H.264 6Mbit/s)", }, 'noccam-raw' => { 'type' => 'camera', 'quality' => 'hd', 'priority' => 130, - 'url' => 'http://cubemap.tg15.gathering.org/noccam.flv', + 'main_url' => 'http://cubemap.tg16.gathering.org/noccam.flv', + 'fallback_url' => 'http://stream.tg16.gathering.org/hls/noccam.m3u8', 'port' => 80, # <-- Safe to remove 'external' => 1, + 'ts_enabled' => 1, 'has_multicast' => 0, # <-- Safe to remove 'interlaced' => 0, # <-- Safe to remove 'online' => 1, 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::18]:2018",# <-- Safe to remove 'source' => "Tech", # <-- Safe to remove - 'title' => "Webcam NOC (HD) (720p H.264) 3Mbit/s" + 'title' => "Webcam NOC (720p H.264 6Mbit/s)" }, -); + 'Event' => { + 'type' => 'event', + 'quality' => 'hd', + 'priority' => 12, + 'main_url' => 'http://cubemap.tg16.gathering.org/event.flv', + 'mp4_url' => 'http://cubemap.tg16.gathering.org/event.mp4', + 'fallback_url' => 'http://stream.tg16.gathering.org/hls/event.m3u8', + 'port' => 80, + 'ts_enabled' => 1, + 'interlaced' => 0, + 'has_multicast' => 0, + 'external' => 1, # <-- In use (Need to rebuild row 67 in index.pl) + 'online' => 1, +# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]", + 'source' => 'Tech', + 'title' => "Event/Stage (720p H.264 6Mbit/s)", + }, + + 'Game' => { + 'type' => 'event', + 'quality' => 'hd', + 'priority' => 13, + 'main_url' => 'http://cubemap.tg16.gathering.org/game.flv', + 'fallback_url' => 'http://stream.tg16.gathering.org/hls/game.m3u8', + 'port' => 80, + 'ts_enabled' => 1, + 'interlaced' => 0, + 'has_multicast' => 0, + 'external' => 1, # <-- In use (Need to rebuild row 67 in index.pl) + 'online' => 0, +# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]", + 'source' => 'Tech', + 'title' => "Game (720p H.264 6Mbit/s)", + }, + + 'Creative' => { + 'type' => 'event', + 'quality' => 'hd', + 'priority' => 14, + 'main_url' => 'http://cubemap.tg16.gathering.org/creativia.flv', + 'fallback_url' => 'http://stream.tg16.gathering.org/hls/creativia.m3u8', + 'port' => 80, + 'ts_enabled' => 1, + 'interlaced' => 0, + 'has_multicast' => 0, + 'external' => 1, # <-- In use (Need to rebuild row 67 in index.pl) + 'online' => 1, +# 'multicast_ip' => "udp://@[ff7e:a40:2a02:ed02:ffff::16]", + 'source' => 'Tech', + 'title' => "Creative (720p H.264 6Mbit/s)", + } + +); 1; |