[FEATURE] Add MediaViewHelper
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Feature-66366-IntroducedMediaViewHelper.rst
1 ============================================
2 Feature: #66366 - Introduced MediaViewHelper
3 ============================================
4
5 Description
6 ===========
7
8 In order to comfortably render video, audio and all other file types with a registered Renderer class (RenderingRegistry
9 introduced with #61800) in FE, the ``MediaViewHelper`` has been added.
10
11 The ``MediaViewHelper`` first checks if there is a Renderer present for the given file. If not, it will as fallback
12 render a image tag. This way it is a replacement for the ImageViewHelper in most cases. classes for rendering video and
13 audio tags.
14
15 Examples:
16 ---------
17
18 .. code-block:: html
19
20 <code title="Image Object">
21 <f:media file="{file}" width="400" height="375" />
22 </code>
23 <output>
24 <img alt="alt set in image record" src="fileadmin/_processed_/323223424.png" width="396" height="375" />
25 </output>
26
27 <code title="MP4 Video Object">
28 <f:media file="{file}" width="400" height="375" />
29 </code>
30 <output>
31 <video width="400" height="375" controls><source src="fileadmin/user_upload/my-video.mp4" type="video/mp4"></video>
32 </output>
33
34 <code title="MP4 Video Object with loop and autoplay option set">
35 <f:media file="{file}" width="400" height="375" additionalConfig="{loop: '1', autoplay: '1'}" />
36 </code>
37 <output>
38 <video width="400" height="375" controls loop><source src="fileadmin/user_upload/my-video.mp4" type="video/mp4"></video>
39 </output>