diff options
Diffstat (limited to '')
-rw-r--r-- | lib/config.php | 17 | ||||
-rw-r--r-- | lib/helper.php | 28 |
2 files changed, 29 insertions, 16 deletions
diff --git a/lib/config.php b/lib/config.php index 9ef612d..c5bed0c 100644 --- a/lib/config.php +++ b/lib/config.php @@ -23,21 +23,18 @@ $GLOBALS['CONFIG']['ROOMS'] = array( ); $GLOBALS['CONFIG']['FORMATS'] = array( - 'hd' => 'FullHD', - 'hq' => 'High Quality', - 'lq' => 'Low Quality', + 'hd' => 'FullHD Video', + 'sd' => 'SD Video', 'audio' => 'Audio', 'slides' => 'Slide-Images', ); $GLOBALS['CONFIG']['FORMAT_TEXT'] = array( - 'hd' => '1920x1080, h264+aac, 5 MBit/s', - 'hq' => '1024x576, h264+aac, 1 MBit/s', - 'lq' => '640x360, h264+aac, 0.5 MBit/s', - 'webm' => '1024x576 vp8+vorbis in webm, zzz MBit/s', - 'mp3' => 'MP3, 192 kBit/s', - 'ogg' => 'OGG Vorbis, xxx kBit/s', - 'opus' => 'Opus (RFC 6716), yyy kBit/s', + 'hd' => '1920x1080, h264+aac, 3 MBit/s', + 'sd' => '1024x576, h264+aac, 1 MBit/s', + 'webm' => '1024x576 vp8+vorbis in webm, 1 MBit/s', + 'mp3' => 'MP3, 128 kBit/s', + 'opus' => 'Opus (RFC 6716), 96 kBit/s', ); // various room-name nappings diff --git a/lib/helper.php b/lib/helper.php index 450b3e9..a09b3ea 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -14,7 +14,7 @@ function link_room($room) function link_player($room, $format, $translated = false) { - $isDefaultFormat = in_array($format, array('hq', 'video')); + $isDefaultFormat = in_array($format, array('sd', 'video')); return rawurlencode($room).'/'.($isDefaultFormat ? '' : rawurlencode($format).'/').($translated ? 'translated/' : ''); } @@ -25,24 +25,40 @@ function link_stream($protocol, $room, $format, $translated = false) switch ($protocol) { case 'rtmp': - return 'rtmp://'.($format == 'hd' ? 'rtmp' : 'rtmp-sd').'.stream.c3voc.de:1935/stream/'.rawurlencode($room).'_'.rawurlencode($language).'_'.rawurlencode($format); + return 'rtmp://rtmp.stream.c3voc.de:1935/stream/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'_'.rawurlencode($format); case 'hls': - return 'http://hls.stream.c3voc.de/hls/'.rawurlencode($room).'_'.rawurlencode($language).'_'.rawurlencode($format).'.m3u8'; + return 'http://hls.stream.c3voc.de/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).($format == 'auto' ? '' : '_'.rawurlencode($format)).'.m3u8'; case 'webm': - return 'http://webm.stream.c3voc.de:8000/'.rawurlencode($room).'_'.rawurlencode($language).'.'.rawurlencode($format); + return 'http://webm.stream.c3voc.de:8000/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'_'.rawurlencode($format).'.webm'; case 'audio': - return 'http://audio.stream.c3voc.de:8000/'.rawurlencode($room).'_'.rawurlencode($language).'.'.rawurlencode($format); + if(in_array($room, array('lounge', 'ambient'))) + return 'http://audio.stream.c3voc.de:8000/'.rawurlencode(streamname($room)).'.'.rawurlencode($format); + else + return 'http://audio.stream.c3voc.de:8000/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'.'.rawurlencode($format); case 'slide': - return 'http://www.stream.c3voc.de/slides/'.rawurlencode($room).'/current.png'; + return 'http://www.stream.c3voc.de/slides/'.rawurlencode(streamname($room)).'/current.png'; } return '#'; } +function streamname($room) +{ + switch($room) + { + case 'saal1': return 's1'; + case 'saal2': return 's2'; + case 'saalg': return 's3'; + case 'saal6': return 's4'; + case 'sendezentrum': return 's5'; + default: return $room; + } +} + function irc_channel($room) { return '31C3-hall-'.strtoupper(substr($room, 4, 1)); |