From b07e1beaa8e3ff0653ea5b02cd26737c227dc667 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 1 Mar 2015 16:17:20 +0100 Subject: [PATCH] music & audio tabs --- lib/helper.php | 16 ++++++++---- pages/room.php | 6 ++++- template/assemblies/player/audio.phtml | 26 ++++++++++++------ template/assemblies/player/music.phtml | 24 +++++++++++++++++ template/assemblies/switcher/audio.phtml | 32 +++++++++-------------- template/assemblies/switcher/music.phtml | 21 +++++++++++++++ template/assemblies/switcher/slides.phtml | 30 ++++++++------------- 7 files changed, 102 insertions(+), 53 deletions(-) create mode 100644 template/assemblies/player/music.phtml create mode 100644 template/assemblies/switcher/music.phtml diff --git a/lib/helper.php b/lib/helper.php index 699c44eb..efdf84cf 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -33,11 +33,11 @@ function link_stream($protocol, $room, $format, $translated = false) case 'webm': return 'http://cdn.c3voc.de/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'_'.rawurlencode($format).'.webm'; + case 'music': + return 'http://cdn.c3voc.de/'.rawurlencode(streamname($room)).'.'.rawurlencode($format); + case 'audio': - if(in_array($room, array('lounge', 'ambient'))) - return 'http://cdn.c3voc.de/'.rawurlencode(streamname($room)).'.'.rawurlencode($format); - else - return 'http://cdn.c3voc.de/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'.'.rawurlencode($format); + return 'http://cdn.c3voc.de/'.rawurlencode(streamname($room)).'_'.rawurlencode($language).'.'.rawurlencode($format); case 'slide': return 'http://cdn.c3voc.de/slides/'.rawurlencode(streamname($room)).'/current.png'; @@ -157,7 +157,13 @@ function room_has_video($room) function room_has_audio($room) { $formats = get("ROOMS.$room.FORMATS"); - return count(array_intersect(array('audio-mp3', 'audio-opus'), $formats)) > 0; + return count(array_intersect(array('audio-mp3', 'audio-opus', 'audio-ogg'), $formats)) > 0; +} + +function room_has_music($room) +{ + $formats = get("ROOMS.$room.FORMATS"); + return count(array_intersect(array('music-mp3', 'music-opus', 'music-ogg'), $formats)) > 0; } function room_has_slides($room) diff --git a/pages/room.php b/pages/room.php index 526aabd7..18bbe7f3 100644 --- a/pages/room.php +++ b/pages/room.php @@ -28,6 +28,9 @@ if(room_has_video($room)) if(room_has_audio($room)) $selections[] = $tabs[] = 'audio'; +if(room_has_music($room)) + $selections[] = $tabs[] = 'music'; + if(room_has_slides($room)) $selections[] = $tabs[] = 'slides'; @@ -42,6 +45,7 @@ if(room_has_hls($room)) $protos[] = 'hls'; + // default page if(!$selection) $selection = $selections[0]; @@ -58,7 +62,7 @@ switch($selection) { break; case 'music': - $tab = 'audio'; + $tab = 'music'; $title = 'Music'; break; diff --git a/template/assemblies/player/audio.phtml b/template/assemblies/player/audio.phtml index c1c7f8f7..e007ab38 100644 --- a/template/assemblies/player/audio.phtml +++ b/template/assemblies/player/audio.phtml @@ -3,12 +3,22 @@ preload="auto" style="width: 230px;" > - - + + + + + + + + + diff --git a/template/assemblies/player/music.phtml b/template/assemblies/player/music.phtml new file mode 100644 index 00000000..587d2d28 --- /dev/null +++ b/template/assemblies/player/music.phtml @@ -0,0 +1,24 @@ + diff --git a/template/assemblies/switcher/audio.phtml b/template/assemblies/switcher/audio.phtml index 9e42e0b4..a0628545 100644 --- a/template/assemblies/switcher/audio.phtml +++ b/template/assemblies/switcher/audio.phtml @@ -1,12 +1,11 @@
-

Audio

-
+ +

Audio

+
-
-
-
Audio
- - + -
-
+
+

Directlinks

- +
@@ -54,8 +46,8 @@ - - video + + audio diff --git a/template/assemblies/switcher/music.phtml b/template/assemblies/switcher/music.phtml new file mode 100644 index 00000000..b844ae8d --- /dev/null +++ b/template/assemblies/switcher/music.phtml @@ -0,0 +1,21 @@ +
+

Directlinks

+
+ + +
+ +
+
+ + + + music + + +
+
+ + +
+
diff --git a/template/assemblies/switcher/slides.phtml b/template/assemblies/switcher/slides.phtml index 45af0d03..f713ab92 100644 --- a/template/assemblies/switcher/slides.phtml +++ b/template/assemblies/switcher/slides.phtml @@ -1,12 +1,11 @@
-

Slides

-
+ +

Slides

+
-
-
-
Slides
- - + -
-
+
+

Directlinks

@@ -52,8 +44,8 @@ - - video + + slides