2 namespace TYPO3\CMS\Core\Resource\Rendering;
66 if ($this->onlineMediaHelper === null) {
69 $orgFile = $orgFile->getOriginalFile();
71 if ($orgFile instanceof
File) {
74 $this->onlineMediaHelper =
false;
90 public function render(
FileInterface $file, $width, $height, array $options = null, $usedPathsRelativeToCurrentScript =
false)
94 if ($autoplay !== null) {
95 $options[
'autoplay'] = $autoplay;
100 if (!empty($options[
'autoplay'])) {
101 $urlParams[] =
'autoplay=1';
103 if (!empty($options[
'loop'])) {
104 $urlParams[] =
'loop=1';
106 $urlParams[] =
'title=' . (int)!empty($options[
'showinfo']);
107 $urlParams[] =
'byline=' . (int)!empty($options[
'showinfo']);
108 $urlParams[] =
'portrait=0';
110 if ($file instanceof FileReference) {
111 $orgFile = $file->getOriginalFile();
117 $src = sprintf(
'//player.vimeo.com/video/%s?%s', $videoId, implode(
'&', $urlParams));
119 $attributes = [
'allowfullscreen'];
120 if ((
int)$width > 0) {
121 $attributes[] =
'width="' . (int)$width .
'"';
123 if ((
int)$height > 0) {
124 $attributes[] =
'height="' . (int)$height .
'"';
126 if (is_object(
$GLOBALS[
'TSFE']) &&
$GLOBALS[
'TSFE']->config[
'config'][
'doctype'] !==
'html5') {
127 $attributes[] =
'frameborder="0"';
129 foreach ([
'class',
'dir',
'id',
'lang',
'style',
'title',
'accesskey',
'tabindex',
'onclick'] as $key) {
130 if (!empty($options[$key])) {
131 $attributes[] = $key .
'="' . htmlspecialchars($options[$key]) .
'"';
136 '<iframe src="%s"%s></iframe>',
138 empty($attributes) ?
'' :
' ' . implode(
' ', $attributes)