Skip to content
Code-Schnipsel Gruppen Projekte
Commit b4d09fc7 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

refactor: Missing video attributes added quiqqer/quiqqer#1178

Übergeordneter c2c81b84
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -170,10 +170,13 @@ function smarty_function_image($params, $smarty)
$html = '';
if (strpos($mimeType, 'video/') === 0) {
$width = '';
$height = '';
$controls = '';
$autoplay = '';
$width = '';
$height = '';
$controls = '';
$autoplay = '';
$loop = '';
$muted = '';
$playsinline = '';
if (isset($params['width'])) {
$width = $params['width'];
......@@ -188,7 +191,19 @@ function smarty_function_image($params, $smarty)
}
if (!empty($params['autoplay'])) {
$autoplay = 'autoplay';
$autoplay = 'autoplay=""';
}
if (!empty($params['loop'])) {
$loop = 'loop=""';
}
if (!empty($params['muted'])) {
$muted = 'muted=""';
}
if (!empty($params['playsinline'])) {
$playsinline = 'playsinline=""';
}
$src = $Image->getUrl(true);
......@@ -203,8 +218,8 @@ function smarty_function_image($params, $smarty)
}
$html = '
<video width="' . $width . '" height="' . $height . '" ' . $controls . ' ' . $autoplay . '>
<source src="' . $src . '" type="' . $type . '" />
<video width="'.$width.'" height="'.$height.'" '.$controls.' '.$autoplay.' '.$loop.' '.$muted.' '.$playsinline.' >
<source src="'.$src.'" type="'.$type.'" />
Your browser does not support the video tag.
</video>
';
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren