mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
Allowed multi translation for embedding, fixed autoplay option
This commit is contained in:
parent
be515f5150
commit
eed207f8df
6 changed files with 33 additions and 11 deletions
|
@ -374,7 +374,13 @@ $(function() {
|
|||
if(!originalsrc)
|
||||
originalsrc = $iframe.attr('src');
|
||||
|
||||
var src = originalsrc + (autoplay ? '' : 'no-autoplay/');
|
||||
var src = originalsrc;
|
||||
if (! autoplay) {
|
||||
if (src.slice(-1) !== '/') {
|
||||
src += '/';
|
||||
}
|
||||
src += 'no-autoplay'
|
||||
}
|
||||
|
||||
$iframe.attr({width: selected[0], height: selected[1]});
|
||||
$iframe.attr({src: src});
|
||||
|
|
|
@ -315,9 +315,7 @@ try {
|
|||
require('view/room.php');
|
||||
}
|
||||
|
||||
// TODO use dynamic i18n parameter
|
||||
// TODO change to no-autoplay query parameter?
|
||||
else if(preg_match('@^embed/([^/]+)/(hd|sd|audio|slides)/(native|translated|translated2|stereo)(/no-autoplay)?$@', $route, $m))
|
||||
else if(preg_match('@^embed/([^/]+)/(hd|sd|audio|slides)/(native|stereo|[^/]+)(/no-autoplay)?$@', $route, $m))
|
||||
{
|
||||
$_GET = array(
|
||||
'room' => $m[1],
|
||||
|
|
|
@ -337,10 +337,13 @@ class Room
|
|||
throw new NotFoundException('Selection '.$selection.' in Room '.$this->getSlug());
|
||||
|
||||
$translation_label = null;
|
||||
if (substr($language, 0, strlen('native')) !== 'native') {
|
||||
if ($language !== 'native' && $language !== 'stereo') {
|
||||
if (! $this->hasTranslation()) {
|
||||
throw new NotFoundException('Translated Streams of Room '. $this->getSlug());
|
||||
}
|
||||
if (! $this->isValidLanguage($language)) {
|
||||
throw new NotFoundException('Selected translation');
|
||||
}
|
||||
|
||||
$translation_label = $this->findTranslationLabel($language);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,9 @@ class Stream
|
|||
|
||||
public function isTranslated()
|
||||
{
|
||||
return !empty($this->getLanguage()) && $this->getLanguage() !== 'native';
|
||||
return !empty($this->getLanguage()) &&
|
||||
$this->getLanguage() !== 'native' &&
|
||||
$this->getLanguage() !== 'stereo';
|
||||
}
|
||||
|
||||
public function getVideoSize()
|
||||
|
|
|
@ -1,11 +1,24 @@
|
|||
<?php
|
||||
|
||||
$room = $conference->getRoom($_GET['room']);
|
||||
|
||||
if(!$room->hasEmbed())
|
||||
throw new NotFoundException('Embedding is not enabled in this room');
|
||||
|
||||
$stream = $room->selectStream(
|
||||
$_GET['selection'], $_GET['language']);
|
||||
$selection = $_GET['selection'];
|
||||
$language = $_GET['language'];
|
||||
|
||||
if ($language !== 'native' && $language !== 'stereo') {
|
||||
if (! $room->hasTranslation()) {
|
||||
throw new NotFoundException('Not translated');
|
||||
}
|
||||
|
||||
if (! $room->isValidLanguage($language)) {
|
||||
throw new NotFoundException('Language not found');
|
||||
}
|
||||
}
|
||||
|
||||
$stream = $room->selectStream($selection, $language);
|
||||
|
||||
echo $tpl->render(array(
|
||||
'page' => 'embed',
|
||||
|
|
Loading…
Reference in a new issue