2 namespace TYPO3\CMS\Core\Resource\Rendering;
67 public function render(
FileInterface $file, $width, $height, array $options = array(), $usedPathsRelativeToCurrentScript =
false)
71 if (!isset($options[
'autoplay']) && $file instanceof
FileReference) {
73 if ($autoplay !== null) {
74 $options[
'autoplay'] = $autoplay;
79 if ((
int)$width > 0) {
80 $attributes[] =
'width="' . (int)$width .
'"';
82 if ((
int)$height > 0) {
83 $attributes[] =
'height="' . (int)$height .
'"';
85 if (!isset($options[
'controls']) || !empty($options[
'controls'])) {
86 $attributes[] =
'controls';
88 if (!empty($options[
'autoplay'])) {
89 $attributes[] =
'autoplay';
91 if (!empty($options[
'muted'])) {
92 $attributes[] =
'muted';
94 if (!empty($options[
'loop'])) {
95 $attributes[] =
'loop';
97 foreach ([
'class',
'dir',
'id',
'lang',
'style',
'title',
'accesskey',
'tabindex',
'onclick'] as $key) {
98 if (!empty($options[$key])) {
99 $attributes[] = $key .
'="' . htmlspecialchars($options[$key]) .
'"';
104 '<video%s><source src="%s" type="%s"></video>',
105 empty($attributes) ?
'' :
' ' . implode(
' ', $attributes),
106 htmlspecialchars($file->
getPublicUrl($usedPathsRelativeToCurrentScript)),