Problem/Motivation
When iframe_consent is enabled, OrejimeResourceFetcher::changeUrl() unconditionally appends &autoplay=1 to YouTube and Vimeo iframe URLs after the user gives consent. This means videos always autoplay after consent, which is not always the desired behavior.
Steps to reproduce
- Enable the
iframe_consentoption in Orejime settings. - Place a YouTube or Vimeo media on any page.
- Visit the page, accept consent for the video.
- The video plays automatically.
Proposed resolution
Add a dedicated checkbox in the Orejime administration settings to control whether autoplay is triggered after consent, independent of the iframe_consent toggle:
iframe_consent: enable/disable iframe blocking (existing)iframe_consent_autoplay: autoplay video after consent (new, defaults toTRUEfor backwards compatibility)
changeUrl() would only append &autoplay=1 when both iframe_consent and iframe_consent_autoplay are enabled.
Remaining tasks
- Add
iframe_consent_autoplaysetting to the Orejime settings form - Update
OrejimeResourceFetcher::changeUrl()to check the new setting - Add the setting to the config schema
- Write tests
User interface changes
A new checkbox "Autoplay video after consent" is added to the Orejime administration settings page, visible only when iframe_consent is enabled.
API changes
None.
Data model changes
A new boolean key iframe_consent_autoplay is added to the orejime.settings config object.
Issue fork orejime-3608679
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
macsim commented