MediaViewHelper extends AbstractTagBasedViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:media>
Render a given media file with the correct html tag.
It asks the :php:RendererRegistry
for the correct Renderer class and if not found it falls
back to the :php:ImageViewHelper
as that is the "Renderer" class for images in Fluid context.
Examples
Image Object
::
<f:media file="{file}" width="400" height="375" />
Output::
MP4 Video Object
::
<f:media file="{file}" width="400" height="375" />
Output::
MP4 Video Object with loop and autoplay option set
::
<f:media file="{file}" width="400" height="375" additionalConfig="{loop: '1', autoplay: '1'}" />
Output::
Table of Contents
Properties
- $tagName : string
Methods
- initializeArguments() : mixed
- Initialize arguments.
- render() : string
- Render a given media file
- getImageService() : ImageService
- Return an instance of ImageService
- renderImage() : string
- Render img tag
Properties
$tagName
protected
string
$tagName
= 'img'
Methods
initializeArguments()
Initialize arguments.
public
initializeArguments() : mixed
render()
Render a given media file
public
render() : string
Tags
Return values
string —Rendered tag
getImageService()
Return an instance of ImageService
protected
getImageService() : ImageService
Return values
ImageServicerenderImage()
Render img tag
protected
renderImage(FileInterface $image, string $width, string $height, string|null $fileExtension) : string
Parameters
- $image : FileInterface
- $width : string
- $height : string
- $fileExtension : string|null
Return values
string —Rendered img tag