Override Vidstack formatter settings using entity fields (hide controls, autoplay, mute & loop)

Created on 28 April 2025, 2 days ago

Problem/Motivation

The original plan was to override the Vidstack formatter settings (which are set as data attributes) right in the Twig templates. This failed because using Twig Tweaks drupal_field() with the settings override, does not "merge" the overridden settings with the settings configured in the formatter, instead it uses the formatters default values for all settings that are not explicitly set.

Steps to reproduce

Proposed resolution

Override the values in a hook using PHP.

The relevant settings are:
- hide controls (n/a yet, see: 📌 The name of the "Show Controls" setting is misleading + a real "Show/Hide Controls" setting is required Active )
- autoplay
- mute
- loop

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024