Bug #78053 ยป YoutubeRenderer.patch
typo3/sysext/core/Classes/Resource/Rendering/YouTubeRenderer.php (revision ) | ||
---|---|---|
}
|
||
}
|
||
$urlParams = ['autohide=1'];
|
||
if (!isset($options['controls']) || !empty($options['controls'])) {
|
||
$urlParams[] = 'controls=2';
|
||
if ($file instanceof FileReference) {
|
||
$orgFile = $file->getOriginalFile();
|
||
} else {
|
||
$orgFile = $file;
|
||
}
|
||
$videoId = $this->getOnlineMediaHelper($file)->getOnlineMediaId($orgFile);
|
||
$urlParams = [
|
||
'autohide=' . (isset($options['autohide']) ? (int) $options['autohide'] : 1),
|
||
'controls=' . (isset($options['controls']) ? (int) $options['controls'] : 2),
|
||
];
|
||
if (!empty($options['autoplay'])) {
|
||
$urlParams[] = 'autoplay=1';
|
||
}
|
||
if (!empty($options['loop'])) {
|
||
$urlParams[] = 'loop=1';
|
||
$urlParams[] = 'loop=1&playlist=' . $videoId;
|
||
}
|
||
if (!isset($options['enablejsapi']) || !empty($options['enablejsapi'])) {
|
||
$urlParams[] = 'enablejsapi=1&origin=' . GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
|
||
}
|
||
$urlParams[] = 'showinfo=' . (int)!empty($options['showinfo']);
|
||
if ($file instanceof FileReference) {
|
||
$orgFile = $file->getOriginalFile();
|
||
} else {
|
||
$orgFile = $file;
|
||
}
|
||
$videoId = $this->getOnlineMediaHelper($file)->getOnlineMediaId($orgFile);
|
||
$src = sprintf(
|
||
'//www.youtube%s.com/embed/%s?%s',
|
||
!empty($options['no-cookie']) ? '-nocookie' : '',
|