From eed207f8dfd68117715518c83fc32d3ae9e1e094 Mon Sep 17 00:00:00 2001 From: dedeibel Date: Sun, 10 Dec 2017 18:02:48 +0100 Subject: Allowed multi translation for embedding, fixed autoplay option --- view/embed.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'view/embed.php') diff --git a/view/embed.php b/view/embed.php index eb7caee..aaf203d 100644 --- a/view/embed.php +++ b/view/embed.php @@ -1,11 +1,24 @@ 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', -- cgit v1.2.3 From 0b73843d5e0d0ac22a46db28090e707566668ae4 Mon Sep 17 00:00:00 2001 From: dedeibel Date: Mon, 11 Dec 2017 20:03:35 +0100 Subject: Leading Spaces to Tabs --- view/embed.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'view/embed.php') diff --git a/view/embed.php b/view/embed.php index aaf203d..97df148 100644 --- a/view/embed.php +++ b/view/embed.php @@ -9,13 +9,13 @@ $selection = $_GET['selection']; $language = $_GET['language']; if ($language !== 'native' && $language !== 'stereo') { - if (! $room->hasTranslation()) { - throw new NotFoundException('Not translated'); - } + if (! $room->hasTranslation()) { + throw new NotFoundException('Not translated'); + } - if (! $room->isValidLanguage($language)) { - throw new NotFoundException('Language not found'); - } + if (! $room->isValidLanguage($language)) { + throw new NotFoundException('Language not found'); + } } $stream = $room->selectStream($selection, $language); -- cgit v1.2.3