diff options
Diffstat (limited to 'template/assemblies')
-rw-r--r-- | template/assemblies/chat.phtml | 13 | ||||
-rw-r--r-- | template/assemblies/player/audio.phtml | 26 | ||||
-rw-r--r-- | template/assemblies/player/music.phtml | 26 | ||||
-rw-r--r-- | template/assemblies/player/slides.phtml | 20 | ||||
-rw-r--r-- | template/assemblies/player/video.phtml | 42 | ||||
-rw-r--r-- | template/assemblies/switcher/audio.phtml | 33 | ||||
-rw-r--r-- | template/assemblies/switcher/music.phtml | 23 | ||||
-rw-r--r-- | template/assemblies/switcher/slides.phtml | 52 | ||||
-rw-r--r-- | template/assemblies/switcher/video.phtml | 36 |
9 files changed, 117 insertions, 154 deletions
diff --git a/template/assemblies/chat.phtml b/template/assemblies/chat.phtml index 85245b2..8498c45 100644 --- a/template/assemblies/chat.phtml +++ b/template/assemblies/chat.phtml @@ -1,14 +1,15 @@ -<? if(room_has_irc($room)): ?> +<? if($room->hasIrc()): ?> <div> - <a class="btn btn-primary irclink" href="<?=h(room_get_irc_url($room))?>" target="_blank"> - <span class="fa fa-comment"></span> <?=h(room_get_irc_display($room))?> + <a class="btn btn-primary irclink" href="<?=h($room->getIrcUrl())?>" target="_blank"> + <span class="fa fa-comment"></span> <?=h($room->getIrcDisplay())?> </a> </div> <? endif ?> -<? if(room_has_twitter($room)): ?> + +<? if($room->hasTwitter($room)): ?> <div> - <a class="btn twitterlink" href="https://twitter.com/intent/tweet?text=<?=h(rawurlencode(room_get_twitter_hashtag($room)))?>" target="_blank"> - <span class="fa fa-twitter"></span> <?=h(room_get_twitter_display($room))?> + <a class="btn twitterlink" href="<?=h($room->getTwitterUrl())?>" target="_blank"> + <span class="fa fa-twitter"></span> <?=h($room->getTwitterDisplay())?> </a> </div> <? endif ?> diff --git a/template/assemblies/player/audio.phtml b/template/assemblies/player/audio.phtml index e007ab3..f8ed579 100644 --- a/template/assemblies/player/audio.phtml +++ b/template/assemblies/player/audio.phtml @@ -3,22 +3,12 @@ preload="auto" style="width: 230px;" > - <? if(in_array("audio-mp3", $formats)): ?> - <source - src="<?=h(link_stream('audio', $room, 'mp3', @$translated))?>" - type="audio/mp3" - /> - <? endif ?> - <? if(in_array("audio-opus", $formats)): ?> - <source - src="<?=h(link_stream('audio', $room, 'opus', @$translated))?>" - type="audio/opus" - /> - <? endif ?> - <? if(in_array("audio-ogg", $formats)): ?> - <source - src="<?=h(link_stream('audio', $room, 'ogg', @$translated))?>" - type="audio/ogg" - /> - <? endif ?> + <source + src="<?=h($stream->getAudioUrl('mp3'))?>" + type="audio/mp3" + /> + <source + src="<?=h($stream->getAudioUrl('opus'))?>" + type="audio/opus" + /> </audio> diff --git a/template/assemblies/player/music.phtml b/template/assemblies/player/music.phtml index 587d2d2..b1c804a 100644 --- a/template/assemblies/player/music.phtml +++ b/template/assemblies/player/music.phtml @@ -3,22 +3,12 @@ preload="auto" style="width: 230px;" > - <? if(in_array("music-mp3", $formats)): ?> - <source - src="<?=h(link_stream('music', $room, 'mp3', @$translated))?>" - type="audio/mp3" - /> - <? endif ?> - <? if(in_array("music-opus", $formats)): ?> - <source - src="<?=h(link_stream('music', $room, 'opus', @$translated))?>" - type="audio/opus" - /> - <? endif ?> - <? if(in_array("music-ogg", $formats)): ?> - <source - src="<?=h(link_stream('music', $room, 'ogg', @$translated))?>" - type="audio/ogg" - /> - <? endif ?> + <source + src="<?=h($stream->getMusicUrl('mp3'))?>" + type="audio/mp3" + /> + <source + src="<?=h($stream->getMusicUrl('opus'))?>" + type="audio/opus" + /> </audio> diff --git a/template/assemblies/player/slides.phtml b/template/assemblies/player/slides.phtml index c2720d6..7887aa0 100644 --- a/template/assemblies/player/slides.phtml +++ b/template/assemblies/player/slides.phtml @@ -1,28 +1,22 @@ -<div style="width: 100%; height: 100%; max-width: <?=h($width)?>px; margin: 0 auto;"> +<div style="max-width: <?=h($stream->getVideoWidth())?>px; max-height: <?=h($stream->getVideoHeight())?>px;" class="video-wrap"> <video autoplay="autoplay" preload="auto" - width="<?=h($width)?>" - height="<?=h($height)?>" + width="<?=h($stream->getVideoWidth())?>" + height="<?=h($stream->getVideoHeight())?>" style="width: 100%; height: 100%;" > - <!--source + <source data-plugin-type="native" - src="<?=h(link_stream('webm', $room, 'webm_slides', $translated))?>" + src="<?=h($stream->getSlidesUrl('webm'))?>" title="WebM (Icecast)" type="video/webm" - /--> - <source - data-plugin-type="flash" - src="<?=h(link_stream('rtmp', $room, 'slides', $translated))?>" - title="h.264 (RTMP)" - type="video/rtmp" /> <source data-plugin-type="native" - src="<?=h(link_stream('hls', $room, 'slides', $translated))?>" + src="<?=h($stream->getSlidesUrl('hls'))?>" title="h.264 (HLS)" type="application/vnd.apple.mpegURL" /> </video> -</div>
\ No newline at end of file +</div> diff --git a/template/assemblies/player/video.phtml b/template/assemblies/player/video.phtml index 0861cf8..3ffc333 100644 --- a/template/assemblies/player/video.phtml +++ b/template/assemblies/player/video.phtml @@ -1,34 +1,22 @@ -<div style="max-width: <?=h($width)?>px; max-height: <?=h($height)?>px;" class="video-wrap"> +<div style="max-width: <?=h($stream->getVideoWidth())?>px; max-height: <?=h($stream->getVideoHeight())?>px;" class="video-wrap"> <video autoplay="autoplay" preload="auto" - width="<?=h($width)?>" - height="<?=h($height)?>" + width="<?=h($stream->getVideoWidth())?>" + height="<?=h($stream->getVideoHeight())?>" style="width: 100%; height: 100%;" > - <? if(in_array("webm-$selection", $formats)): ?> - <source - data-plugin-type="native" - src="<?=h(link_stream('webm', $room, $selection, $translated))?>" - title="WebM (Icecast)" - type="video/webm" - /> - <? endif ?> - <? if(in_array("hls-$selection", $formats)): ?> - <source - data-plugin-type="native" - src="<?=h(link_stream('hls', $room, $hlsformat, $translated))?>" - title="h.264 (HLS)" - type="application/vnd.apple.mpegURL" - /> - <? endif ?> - <? if(in_array("rtmp-$selection", $formats)): ?> - <source - data-plugin-type="flash" - src="<?=h(link_stream('rtmp', $room, $selection, $translated))?>" - title="h.264 (RTMP)" - type="video/rtmp" - /> - <? endif ?> + <source + data-plugin-type="native" + src="<?=h($stream->getVideoUrl('webm'))?>" + title="WebM (Icecast)" + type="video/webm" + /> + <source + data-plugin-type="native" + src="<?=h($stream->getVideoUrl('hls'))?>" + title="h.264 (HLS)" + type="application/vnd.apple.mpegURL" + /> </video> </div> 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> |