Switcher-Styles

This commit is contained in:
MaZderMind 2015-03-01 14:49:26 +01:00
parent f8362a9c02
commit 9f5dad12d1
4 changed files with 138 additions and 63 deletions

View file

@ -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)

View file

@ -1,33 +1,68 @@
<h3>Formats</h3>
<ul>
<li>
<span class="label filetype">AUDIO</span>
<a href="<?=h(link_player($room, 'audio'))?>">
<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))?>">
<a href="<?=h(link_player($room, 'audio', true))?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
</li>
</ul>
<hr />
<? 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>
<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))?>">
<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, $iter, true))?>">
<a href="<?=h(link_stream('audio', $room, $proto, true))?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
</li>
<? 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 ?>
</ul>
</div>
</div>

View file

@ -1,31 +1,67 @@
<div class="container-fluid">
<h3>Slides</h3>
<ul>
<li>
<span class="label filetype">SLIDES</span>
<a href="<?=h(link_player($room, 'slides'))?>">
<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))?>">
<a href="<?=h(link_player($room, 'slides', true))?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
</li>
</ul>
<? 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>
<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'))?>">
<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($protocol, $room, 'slides', true))?>">
<a href="<?=h(link_stream($proto, $room, 'slides', true))?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
</li>
<? 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 ?>
</ul>
</div>
</div>

View file

@ -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>