Allow to select an image field as poster

Created on 17 May 2023, about 1 year ago
Updated 30 May 2024, about 1 month ago

Problem/Motivation

https://github.com/sampotts/plyr shows that a poster (data-poster) attribute is supported. So it would be helpful to have an option to select an image field from the same parent entity in the plyr formatter. If left empty, no poster should be added.

Steps to reproduce

Proposed resolution

In the plyr formatter add an optional field: "Poster image"
which allows to select an image field from the parent entity (if one exists).

  • Settings name should be poster_image_field_name
  • Only image fields should be selectable
  • If none is chosen, no data-poster value is added
  • We should discuss to not use the raw image but also select an image style, but that's the 2nd step. Examples for that can be found im modules like photoswipe.

An example how to retrieve fields from the parent entity in a formatter can be found here for example: (field_name)
https://www.drupal.org/project/field_formatter: → https://git.drupalcode.org/project/field_formatter/-/blob/3.x/src/Plugin...

Also there's a starting point for the Core file_video formatter here: ✨ Add poster image to HTML5 media videos Needs work if one of the issues is finished first, the other one could benefit from the code! :)

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.69.0 2024