From e874f667df0fc5d1a610b0200824af2b993aa0be Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 5 May 2013 03:39:13 +0200 Subject: added lac web interface modifications --- contrib/hls/start-hls.sh | 5 +- contrib/www/lac/browser.php | 45 ++++++++++++++ contrib/www/lac/embed-test.html | 14 +++++ contrib/www/lac/embed.php | 21 +++++++ contrib/www/lac/index.php | 13 ++++ contrib/www/lac/init.php | 67 ++++++++++++++++++++ contrib/www/lac/player.php | 131 ++++++++++++++++++++++++++++++++++++++++ contrib/www/lac/style.css | 50 +++++++++++++++ 8 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 contrib/www/lac/browser.php create mode 100644 contrib/www/lac/embed-test.html create mode 100644 contrib/www/lac/embed.php create mode 100644 contrib/www/lac/index.php create mode 100644 contrib/www/lac/init.php create mode 100644 contrib/www/lac/player.php create mode 100644 contrib/www/lac/style.css diff --git a/contrib/hls/start-hls.sh b/contrib/hls/start-hls.sh index 7fa4c19..59a18a6 100755 --- a/contrib/hls/start-hls.sh +++ b/contrib/hls/start-hls.sh @@ -14,7 +14,7 @@ # if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then - echo "Usage: $0 (high|medium|low)" + echo "Usage: $0 (high|medium|low|mini)" exit 1 fi @@ -37,6 +37,9 @@ case "$3" in low) arate=96k ;; + mini) + arate=96k + ;; *) arate=128k ;; diff --git a/contrib/www/lac/browser.php b/contrib/www/lac/browser.php new file mode 100644 index 0000000..5df08dc --- /dev/null +++ b/contrib/www/lac/browser.php @@ -0,0 +1,45 @@ + 'unknown', + 'name' => 'unknown', + 'version' => '0.0.0', + 'majorver' => 0, + 'minorver' => 0, + 'build' => 0, + 'useragent' => '' +); + +$browsers = array( + 'firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', + 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol' +); + +if (isset($_SERVER['HTTP_USER_AGENT'])) { + $browser['useragent'] = $_SERVER['HTTP_USER_AGENT']; + $user_agent = strtolower($browser['useragent']); + foreach($browsers as $_browser) { + if (preg_match("/($_browser)[\/ ]?([0-9.]*)/", $user_agent, $match)) { + $browser['name'] = $match[1]; + $browser['version'] = $match[2]; + @list($browser['majorver'], $browser['minorver'], $browser['build']) = explode('.', $browser['version']); + break; + } + } + if (preg_match('/linux/i', $user_agent)) { + $browser['platform'] = 'linux'; + } + elseif (preg_match('/macintosh|mac os x/i', $user_agent)) { + $browser['platform'] = 'mac'; + } + elseif (preg_match('/windows|win32/i', $user_agent)) { + $browser['platform'] = 'windows'; + } + +} + +if ( isset($_GET['debug']) ) { + echo "
";
+  print_r($browser);
+  echo "
"; +} +?> diff --git a/contrib/www/lac/embed-test.html b/contrib/www/lac/embed-test.html new file mode 100644 index 0000000..12e68b3 --- /dev/null +++ b/contrib/www/lac/embed-test.html @@ -0,0 +1,14 @@ + + + + Linux Audio Conference 2013 - Live Stream + + + +

Linux Audio Conference 2013 - Live Stream (embedded)

+
+ +
+ + diff --git a/contrib/www/lac/embed.php b/contrib/www/lac/embed.php new file mode 100644 index 0000000..5880fa1 --- /dev/null +++ b/contrib/www/lac/embed.php @@ -0,0 +1,21 @@ + + + + Linux Audio Conference 2013 - Live Stream + + + + +
+ +
+ + diff --git a/contrib/www/lac/index.php b/contrib/www/lac/index.php new file mode 100644 index 0000000..a246782 --- /dev/null +++ b/contrib/www/lac/index.php @@ -0,0 +1,13 @@ + + + + Linux Audio Conference 2013 - Live Stream + + + +

Linux Audio Conference 2013 - Live Stream

+
+ +
+ + diff --git a/contrib/www/lac/init.php b/contrib/www/lac/init.php new file mode 100644 index 0000000..849c444 --- /dev/null +++ b/contrib/www/lac/init.php @@ -0,0 +1,67 @@ += 4) || + ($browser['name'] == 'opera' && $browser['majorver'] == 10 && $browser['minorver'] >= 60) || + ($browser['name'] == 'opera' && $browser['majorver'] >= 11) || + ($browser['name'] == 'chrome' && $browser['majorver'] >= 6) || + ($browser['name'] == 'safari' && $browser['platform'] == 'mac')) { + $DEFAULT_MODE = 'html5'; +} + +if ( isset($EMBED) && $EMBED >= 3 ) { + $DEFAULT_PROFILE = 'mini'; +} elseif ( isset($EMBED) && $EMBED >= 2 ) { + $DEFAULT_PROFILE = 'low'; +} else { + $DEFAULT_PROFILE = 'medium'; +} + +$PROFILE= isset($_GET['profile']) ? $_GET['profile'] : $DEFAULT_PROFILE; +switch($PROFILE) { + case 'high': { $WIDTH = 1280; $HEIGHT = 720; break; } + case 'low': { $WIDTH = 640; $HEIGHT = 360; break; } + case 'mini': { $WIDTH = 426; $HEIGHT = 240; break; } + default: { $PROFILE = 'medium'; $WIDTH = 854; $HEIGHT = 480; break; } +} + +$SRC = isset($_GET['src']) ? $_GET['src'] : 'av'; + +$MODE = isset($_GET['mode']) ? $_GET['mode'] : $DEFAULT_MODE; +switch($MODE) { + case 'flash': { break; } + default: { $MODE = 'html5'; break; } +} + +$URL_BASE = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; +$URL_BASE_IDX = preg_replace("/embed(-.*)?\.php/", "index.php", $URL_BASE); + +$URL_FLASH = $URL_BASE . "?mode=flash&src=$SRC&profile=$PROFILE"; +$URL_HTML5 = $URL_BASE . "?mode=html5&src=$SRC&profile=$PROFILE"; + +if ( isset($EMBED) ) { + $URL_HIGH = $URL_BASE_IDX . "?mode=$MODE&src=$SRC&profile=high"; +} else { + $URL_HIGH = $URL_BASE . "?mode=$MODE&src=$SRC&profile=high"; +} +if ( isset($EMBED) && $EMBED >= 2 ) { + $URL_MEDIUM = $URL_BASE_IDX . "?mode=$MODE&src=$SRC&profile=medium"; +} else { + $URL_MEDIUM = $URL_BASE . "?mode=$MODE&src=$SRC&profile=medium"; +} +if ( isset($EMBED) && $EMBED >= 3 ) { + $URL_LOW = $URL_BASE_IDX . "?mode=$MODE&src=$SRC&profile=low"; +} else { + $URL_LOW = $URL_BASE . "?mode=$MODE&src=$SRC&profile=low"; +} +$URL_MINI = $URL_BASE . "?mode=$MODE&src=$SRC&profile=mini"; + + +$STREAM_URL_BASE = 'http://lac-live.spreadspace.org'; +$STREAM_URL_WEBM = "$STREAM_URL_BASE:8000/$SRC-webm-$PROFILE.webm"; +$STREAM_URL_HLS = "$STREAM_URL_BASE/lac-live/$SRC-hls-$PROFILE.m3u8"; +$STREAM_URL_FLASH = "$STREAM_URL_BASE:8000/$SRC-flash-$PROFILE.flv"; + +?> diff --git a/contrib/www/lac/player.php b/contrib/www/lac/player.php new file mode 100644 index 0000000..ba8ee18 --- /dev/null +++ b/contrib/www/lac/player.php @@ -0,0 +1,131 @@ + + + + + + + + + +
+ + + + + + + + + diff --git a/contrib/www/lac/style.css b/contrib/www/lac/style.css new file mode 100644 index 0000000..bc8919a --- /dev/null +++ b/contrib/www/lac/style.css @@ -0,0 +1,50 @@ +body { + background-color: #FFFFFF; + font-family: "Lucida Grande","bitstream vera sans","trebuchet ms",verdana,arial; + text-align: center; +} + +h1 { + letter-spacing: -1px; + color: #2D5AC3; + font-weight: normal; + font-size: 1.7em; +} + +h2 { + letter-spacing: -1px; + font-weight: bold; + font-size: 1.2em; + text-align: left; +} + +table#header +{ + background-color: #333333; +} + +td { + padding: 0.5em 0.7em; +} + +td span { + color: #FFFFFF; +} + +td span a { + color: #AAAAAA; + font-size: 0.8em; + text-decoration: none; +} + +td span a:hover { + text-decoration: underline; +} + +td span.selected { + font-weight: bold; +} + +table#footer td { + padding: 0.3em 0.5em; +} -- cgit v1.2.3