.. include:: /Includes.rst.txt
.. _feature-66371:
=====================================================================
Feature: #66371 - Introduce autoplay option for video and audio files
=====================================================================
See :issue:`66371`
Description
===========
The `RenderingRegistry` added with #61800 introduced the option to render video
and audio tags with the new `MediaViewHelper` added with #66366.
To improve the usability of this feature an autoplay checkbox has been added to
the `sys_file_reference` records to enable the editor to configure this option
on a per file basis.
To make the autoplay option available in sys_file_reference records, make use of
the new palettes `videoOverlayPalette` and `audioOverlayPalette` in your TCA.
However, the autoplay property of the `sys_file_reference` is only taken into
account if the view helper does not explicitly specify an autoplay option.
Examples:
---------
Example config of an sys_file_reference field in TCA:
.. code-block:: php
'media' => array(
'exclude' => 1,
'label' => 'Media',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'media',
array(
'foreign_types' => array(
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
'showitem' => '
--palette--;;audioOverlayPalette,
--palette--;;filePalette',
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
'showitem' => '
--palette--;;videoOverlayPalette,
--palette--;;filePalette',
)
)
),
'wav,mpeg,mp4,ogg'
)
)
.. code-block:: html
.. index:: FAL, TCA, Backend, Frontend