aboutsummaryrefslogtreecommitdiff
path: root/template/assemblies/switcher
diff options
context:
space:
mode:
Diffstat (limited to 'template/assemblies/switcher')
-rw-r--r--template/assemblies/switcher/audio.phtml33
-rw-r--r--template/assemblies/switcher/music.phtml23
-rw-r--r--template/assemblies/switcher/slides.phtml52
-rw-r--r--template/assemblies/switcher/video.phtml36
4 files changed, 72 insertions, 72 deletions
diff --git a/template/assemblies/switcher/audio.phtml b/template/assemblies/switcher/audio.phtml
index 53131d3..9f3ba76 100644
--- a/template/assemblies/switcher/audio.phtml
+++ b/template/assemblies/switcher/audio.phtml
@@ -1,5 +1,6 @@
<div class="container-fluid">
- <? if($has_translation): ?>
+ <? $selection = $room->createSelectionObject('audio') ?>
+ <? if($room->hasTranslation()): ?>
<h3>Audio</h3>
<div class="formats row">
@@ -7,11 +8,11 @@
<div class="btn-group" role="group">
<div class="btn btn-primary" disabled>Audio</div>
- <a href="<?=h(link_player($room, 'audio'))?>" class="btn btn-default">
+ <a href="<?=h($selection->getLink())?>" 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">
+ <a href="<?=h($selection->getTranslatedLink())?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
@@ -23,35 +24,35 @@
<? endif ?>
- <h3>Directlinks</h3>
- <div class="formats row">
- <? foreach(array_intersect($formats, array('audio-mp3', 'audio-opus', 'audio-ogg')) 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" title="<?=h(get("FORMAT.$format"))?>">
- <div class="btn btn-primary" disabled><?=h(strtoupper($proto))?></div>
+ <div class="directlinks">
- <? if($has_translation): ?>
+ <? foreach(Stream::getAudioProtos() as $proto => $display): ?>
+ <h3>Directlinks (<?=h($display)?>)</h3>
+ <div class="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><?=h($selection->getDisplay())?></div>
+ <? if($room->hasTranslation()): ?>
- <a href="<?=h(link_stream('audio', $room, $proto))?>" class="btn btn-default">
+ <a href="<?=h($room->createStreamObject('audio', 'native')->getAudioUrl($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">
+ <a href="<?=h($room->createStreamObject('audio', 'translated')->getAudioUrl($proto))?>" 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">
+ <a href="<?=h($room->createStreamObject('audio')->getAudioUrl($proto))?>" class="btn btn-default">
<span class="fa fa-volume-up"></span>
- audio
+ video
</a>
<? endif ?>
-
+ </div>
</div>
</div>
<? endforeach ?>
diff --git a/template/assemblies/switcher/music.phtml b/template/assemblies/switcher/music.phtml
index df1fbf2..a6b3ffc 100644
--- a/template/assemblies/switcher/music.phtml
+++ b/template/assemblies/switcher/music.phtml
@@ -1,21 +1,20 @@
<div class="container-fluid">
<h3>Directlinks</h3>
- <div class="formats row">
+ <div class="directlinks">
+ <div class="row">
+ <? foreach(Stream::getMusicProtos() as $proto => $display): ?>
+ <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($display)?></div>
- <? foreach(array_intersect($formats, array('music-mp3', 'music-opus', 'music-ogg')) 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" title="<?=h(get("FORMAT.$format"))?>">
- <div class="btn btn-primary" disabled><?=h(strtoupper($proto))?></div>
-
- <a href="<?=h(link_stream('music', $room, $proto))?>" class="btn btn-default">
+ <a href="<?=h($room->createStreamObject('music')->getMusicUrl($proto))?>" class="btn btn-default">
<span class="fa fa-music"></span>
- music
+ live music
</a>
+ </div>
</div>
- </div>
- <? endforeach ?>
-
+ <? endforeach ?>
+ </div>
</div>
</div>
diff --git a/template/assemblies/switcher/slides.phtml b/template/assemblies/switcher/slides.phtml
index 7355da0..a5f5082 100644
--- a/template/assemblies/switcher/slides.phtml
+++ b/template/assemblies/switcher/slides.phtml
@@ -1,5 +1,6 @@
<div class="container-fluid">
- <? if($has_translation): ?>
+ <? $selection = $room->createSelectionObject('audio') ?>
+ <? if($room->hasTranslation()): ?>
<h3>Slides</h3>
<div class="formats row">
@@ -7,11 +8,11 @@
<div class="btn-group" role="group">
<div class="btn btn-primary" disabled>Slides</div>
- <a href="<?=h(link_player($room, 'slides'))?>" class="btn btn-default">
+ <a href="<?=h($selection->getLink())?>" 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">
+ <a href="<?=h($selection->getTranslatedLink())?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
@@ -22,38 +23,39 @@
</div>
<? endif ?>
- <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" title="<?=h(get("FORMAT.slides"))?>">
- <div class="btn btn-primary" disabled><?=h(strtoupper($proto))?></div>
- <? if($has_translation): ?>
+ <div class="directlinks">
- <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>
+ <? foreach(Stream::getSlidesProtos() as $proto => $display): ?>
+ <h3>Directlinks (<?=h($display)?>)</h3>
+ <div class="row">
+ <div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
+ <div class="btn-group" role="group" title="<?=h(get("FORMAT.slides"))?>">
+ <div class="btn btn-primary" disabled><?=h($selection->getDisplay())?></div>
+ <? if($room->hasTranslation()): ?>
- <? else: ?>
+ <a href="<?=h($room->createStreamObject('slides', 'native')->getSlidesUrl($proto))?>" class="btn btn-default">
+ <span class="fa fa-flag-o"></span>
+ native
+ </a>
+ <a href="<?=h($room->createStreamObject('slides', 'translated')->getSlidesUrl($proto))?>" class="btn btn-default">
+ <span class="fa fa-flag"></span>
+ translated
+ </a>
- <a href="<?=h(link_stream($proto, $room, 'slides'))?>" class="btn btn-default">
- <span class="fa fa-picture-o"></span>
- slides
- </a>
+ <? else: ?>
- <? endif ?>
+ <a href="<?=h($room->createStreamObject('slides')->getSlidesUrl($proto))?>" class="btn btn-default">
+ <span class="fa fa-picture-o"></span>
+ slides
+ </a>
+ <? endif ?>
+ </div>
</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 5a35657..c0429d3 100644
--- a/template/assemblies/switcher/video.phtml
+++ b/template/assemblies/switcher/video.phtml
@@ -2,25 +2,26 @@
<h3>Video</h3>
<div class="formats row">
- <? foreach($videores as $iter): ?>
+ <? foreach($room->getVideoResolutions() as $res): ?>
+ <? $selection = $room->createSelectionObject($res) ?>
<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($iter))?></div>
+ <div class="btn btn-primary" disabled><?=h($selection->getDisplay())?></div>
- <? if($has_translation): ?>
+ <? if($room->hasTranslation()): ?>
- <a href="<?=h(link_player($room, $iter))?>" class="btn btn-default">
+ <a href="<?=h($selection->getLink())?>" class="btn btn-default">
<span class="fa fa-flag-o"></span>
native
</a>
- <a href="<?=h(link_player($room, $iter, true))?>" class="btn btn-default">
+ <a href="<?=h($selection->getTranslatedLink())?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
<? else: ?>
- <a href="<?=h(link_player($room, $iter))?>" class="btn btn-default">
+ <a href="<?=h($selection->getLink())?>" class="btn btn-default">
<span class="fa fa-video-camera"></span>
video
</a>
@@ -37,30 +38,28 @@
</div>
<div class="directlinks">
-
- <? foreach($protos as $proto): ?>
- <h3>Directlinks (<?=h(strtoupper($proto))?>)</h3>
+ <? foreach(Stream::getVideoProtos() as $proto => $display): ?>
+ <h3>Directlinks (<?=h($display)?>)</h3>
<div class="row">
- <? foreach($formats as $format): ?>
- <? if(!startswith($proto, $format)) continue ?>
- <? $res = substr($format, -2) ?>
+ <? foreach($room->getVideoResolutions() as $res): ?>
+ <? $selection = $room->createSelectionObject($res) ?>
<div class="col-lg-3 col-md-4 col-lg-5 col-xs-12">
- <div class="btn-group" role="group" title="<?=h(get("FORMAT.$format"))?>">
- <div class="btn btn-primary" disabled><?=h(strtoupper($res))?></div>
- <? if($has_translation): ?>
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled><?=h($selection->getDisplay())?></div>
+ <? if($room->hasTranslation()): ?>
- <a href="<?=h(link_stream($proto, $room, $res))?>" class="btn btn-default">
+ <a href="<?=h($room->createStreamObject($res, 'native')->getVideoUrl($proto))?>" class="btn btn-default">
<span class="fa fa-flag-o"></span>
native
</a>
- <a href="<?=h(link_stream($proto, $room, $res, true))?>" class="btn btn-default">
+ <a href="<?=h($room->createStreamObject($res, 'translated')->getVideoUrl($proto))?>" class="btn btn-default">
<span class="fa fa-flag"></span>
translated
</a>
<? else: ?>
- <a href="<?=h(link_stream($proto, $room, $res))?>" class="btn btn-default">
+ <a href="<?=h($room->createStreamObject($res)->getVideoUrl($proto))?>" class="btn btn-default">
<span class="fa fa-video-camera"></span>
video
</a>
@@ -71,6 +70,5 @@
<? endforeach ?>
</div>
<? endforeach ?>
-
</div>
</div>