benjaminkott / bootstrap_package

Bootstrap Package delivers a full configured theme for TYPO3, based on the Bootstrap CSS Framework.
https://www.bootstrap-package.com/
MIT License
338 stars 205 forks source link

Autoplay option of file references doesn't work #1510

Open fishbone1 opened 1 month ago

fishbone1 commented 1 month ago

Bug Report

Prerequisites

Description

The "autoplay" setting of individual file references in the Media content element is not respected.

Steps to Reproduce

  1. Add a media content element to a page
  2. Add a video media element
  3. Enable the autoplay option
  4. View the page

Expected behavior

The video element has the "autoplay" attribute and autoplays.

Actual behavior

The video element has no "autoplay" attribute and doesn't autoplay.

Screenshots

grafik

grafik

Additional information

Bootstrap Package defines globally for all videos whether autoplay is enabled or not. This makes no sense to me and breaks the "individual autoplay" feature for sys_file_references.

TYPO3's VideoTagRenderer checks if autoplay is passed as an option / additionalConfig (e.g. in <f:media>). If not, is uses the file reference's autoplay option: https://github.com/TYPO3/typo3/blob/28d3a8c5e0b2e60cefdccf89cf47e6ce31bed5e3/typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php#L67

Unfortunately Bootstrap Package always sets this additionalConfig. You can either set it to 1 or 0 with the constant plugin.bootstrap_package_contentelements.media.additionalConfig.autoplay.

Workaround

Unset the value in setup.typoscript:

lib.contentElement.settings.media.additionalConfig.autoplay >