mirror of
https://github.com/voc/streaming-website
synced 2024-11-14 00:17:18 +00:00
dc57652519
The error control operator "@" has changed behavior in PHP8 and generally seems like a quite bad hack. So let's handle array/ dict access errors explicitly.
32 lines
721 B
PHP
32 lines
721 B
PHP
<?php
|
|
|
|
$room = $conference->getRoom($_GET['room']);
|
|
|
|
if(!$room->hasEmbed())
|
|
throw new NotFoundException('Embedding is not enabled in this room');
|
|
|
|
$selection = $_GET['selection'];
|
|
$language = $_GET['language'];
|
|
|
|
if ($language !== 'native') {
|
|
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',
|
|
'naked' => true, // no header/footer
|
|
|
|
'title' => $stream->getDisplay(),
|
|
'room' => $room,
|
|
'stream' => $stream,
|
|
|
|
'autoplay' => isset($_GET['autoplay']) ? $_GET['autoplay'] : false,
|
|
));
|