aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/helper.php2
-rw-r--r--template/assemblies/switcher/audio.phtml101
-rw-r--r--template/assemblies/switcher/slides.phtml98
-rw-r--r--template/assemblies/switcher/video.phtml6
4 files changed, 141 insertions, 66 deletions
diff --git a/lib/helper.php b/lib/helper.php
index fdd472e..699c44e 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -16,7 +16,7 @@ function link_player($room, $format = 'hd', $translated = false)
{
$defaultformat = room_has_hd($room) ? 'hd' : 'sd';
- return rawurlencode($room).'/'.($defaultformat == $format ? '' : rawurlencode($format).'/').($translated ? 'translated/' : '');
+ return rawurlencode($room).'/'.(($defaultformat == $format || 'video' == $format) ? '' : rawurlencode($format).'/').($translated ? 'translated/' : '');
}
function link_stream($protocol, $room, $format, $translated = false)
diff --git a/template/assemblies/switcher/audio.phtml b/template/assemblies/switcher/audio.phtml
index fb12e60..9e42e0b 100644
--- a/template/assemblies/switcher/audio.phtml
+++ b/template/assemblies/switcher/audio.phtml
@@ -1,33 +1,68 @@
-<h3>Formats</h3>
-<ul>
- <li>
- <span class="label filetype">AUDIO</span>
- <a href="<?=h(link_player($room, 'audio'))?>">
- <span class="fa fa-flag-o"></span>
- native
- </a>
- <a href="<?=h(link_player($room, 'audio', true))?>">
- <span class="fa fa-flag"></span>
- translated
- </a>
- </li>
-</ul>
-
-<hr />
-
-<h3>Directlinks</h3>
-<ul>
- <? foreach(array('mp3', 'opus') as $iter): ?>
- <li>
- <span class="label filetype" title="<?=h(format_text($iter))?>"><?=h(strtoupper($iter))?></span>
- <a href="<?=h(link_stream('audio', $room, $iter))?>">
- <span class="fa fa-flag-o"></span>
- native
- </a>
- <a href="<?=h(link_stream('audio', $room, $iter, true))?>">
- <span class="fa fa-flag"></span>
- translated
- </a>
- </li>
- <? endforeach ?>
-</ul>
+<div class="container-fluid">
+ <h3>Audio</h3>
+ <div class="formats row">
+
+ <div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled>Audio</div>
+
+ <? if($has_translation): ?>
+
+ <a href="<?=h(link_player($room, 'audio'))?>" class="btn btn-default">
+ <span class="fa fa-flag-o"></span>
+ native
+ </a>
+ <a href="<?=h(link_player($room, 'audio', true))?>" class="btn btn-default">
+ <span class="fa fa-flag"></span>
+ translated
+ </a>
+
+ <? else: ?>
+
+ <a href="<?=h(link_player($room, 'audio'))?>" class="btn btn-default">
+ <span class="fa fa-video-camera"></span>
+ video
+ </a>
+
+ <? endif ?>
+ </div>
+ </div>
+
+ </div>
+
+
+ <h3>Directlinks</h3>
+ <div class="formats row">
+
+ <? foreach(array_intersect($formats, array('audio-mp3', 'audio-opus')) as $format): ?>
+ <div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
+ <? $proto = substr($format, 6) ?>
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled><?=h(strtoupper($proto))?></div>
+
+ <? if($has_translation): ?>
+
+ <a href="<?=h(link_stream('audio', $room, $proto))?>" class="btn btn-default">
+ <span class="fa fa-flag-o"></span>
+ native
+ </a>
+ <a href="<?=h(link_stream('audio', $room, $proto, true))?>" class="btn btn-default">
+ <span class="fa fa-flag"></span>
+ translated
+ </a>
+
+ <? else: ?>
+
+ <a href="<?=h(link_stream('audio', $room, $proto))?>" class="btn btn-default">
+ <span class="fa fa-video-camera"></span>
+ video
+ </a>
+
+ <? endif ?>
+
+ </div>
+ </div>
+ <? endforeach ?>
+
+ </div>
+</div> \ No newline at end of file
diff --git a/template/assemblies/switcher/slides.phtml b/template/assemblies/switcher/slides.phtml
index 401b4e7..45af0d0 100644
--- a/template/assemblies/switcher/slides.phtml
+++ b/template/assemblies/switcher/slides.phtml
@@ -1,31 +1,67 @@
-<h3>Slides</h3>
-<ul>
- <li>
- <span class="label filetype">SLIDES</span>
- <a href="<?=h(link_player($room, 'slides'))?>">
- <span class="fa fa-flag-o"></span>
- native
- </a>
- <a href="<?=h(link_player($room, 'slides', true))?>">
- <span class="fa fa-flag"></span>
- translated
- </a>
- </li>
-</ul>
-
-<h3>Directlinks</h3>
-<ul>
- <? foreach(array('rtmp', 'hls') as $protocol): ?>
- <li>
- <span class="label filetype" title="<?=h(format_text($iter))?>"><?=h(strtoupper($protocol))?></span>
- <a href="<?=h(link_stream($protocol, $room, 'slides'))?>">
- <span class="fa fa-flag-o"></span>
- native
- </a>
- <a href="<?=h(link_stream($protocol, $room, 'slides', true))?>">
- <span class="fa fa-flag"></span>
- translated
- </a>
- </li>
- <? endforeach ?>
-</ul>
+<div class="container-fluid">
+ <h3>Slides</h3>
+ <div class="formats row">
+
+ <div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled>Slides</div>
+
+ <? if($has_translation): ?>
+
+ <a href="<?=h(link_player($room, 'slides'))?>" class="btn btn-default">
+ <span class="fa fa-flag-o"></span>
+ native
+ </a>
+ <a href="<?=h(link_player($room, 'slides', true))?>" class="btn btn-default">
+ <span class="fa fa-flag"></span>
+ translated
+ </a>
+
+ <? else: ?>
+
+ <a href="<?=h(link_player($room, 'slides'))?>" class="btn btn-default">
+ <span class="fa fa-video-camera"></span>
+ native
+ </a>
+
+ <? endif ?>
+ </div>
+ </div>
+
+ </div>
+
+ <h3>Directlinks</h3>
+ <div class="formats row">
+
+ <? foreach(array_intersect($protos, array('rtmp', 'hls')) as $proto): ?>
+ <div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled><?=h(strtoupper($proto))?></div>
+
+ <? if($has_translation): ?>
+
+ <a href="<?=h(link_stream($proto, $room, 'slides'))?>" class="btn btn-default">
+ <span class="fa fa-flag-o"></span>
+ native
+ </a>
+ <a href="<?=h(link_stream($proto, $room, 'slides', true))?>" class="btn btn-default">
+ <span class="fa fa-flag"></span>
+ translated
+ </a>
+
+ <? else: ?>
+
+ <a href="<?=h(link_stream($proto, $room, 'slides'))?>" class="btn btn-default">
+ <span class="fa fa-video-camera"></span>
+ video
+ </a>
+
+ <? endif ?>
+
+ </div>
+ </div>
+ <? endforeach ?>
+
+ </div>
+
+</div> \ No newline at end of file
diff --git a/template/assemblies/switcher/video.phtml b/template/assemblies/switcher/video.phtml
index 653847c..2017b2e 100644
--- a/template/assemblies/switcher/video.phtml
+++ b/template/assemblies/switcher/video.phtml
@@ -1,6 +1,7 @@
<div class="container-fluid">
- <h3>Formats</h3>
+ <h3>Video</h3>
<div class="formats row">
+
<? foreach($videores as $iter): ?>
<div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
<div class="btn-group" role="group">
@@ -28,6 +29,7 @@
</div>
</div>
<? endforeach ?>
+
</div>
<div class="notes well">
@@ -35,6 +37,7 @@
</div>
<div class="directlinks">
+
<? foreach($protos as $proto): ?>
<h3>Directlinks (<?=h(strtoupper($proto))?>)</h3>
<div class="row">
@@ -68,5 +71,6 @@
<? endforeach ?>
</div>
<? endforeach ?>
+
</div>
</div>