Project

General

Profile

Bug #78053 ยป YoutubeRenderer.patch

Cyril Janody, 2016-09-23 18:54

View differences:

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' : '',
    (1-1/1)