"Implement Responsive Image Styles for YouTube Thumbnails using Video Embed Field Module"

Created on 13 November 2023, 8 months ago

Problem/Motivation

In a recent scenario, I encountered a situation where I needed to display the YouTube video thumbnail for various viewports. To address this, I created a responsive image style. However, I found that there was no option to apply this responsive image style to the YouTube thumbnail.

In my twig, I passed the thumbnail URI to the drupal_image() twig tweak function but the return was NULL
{% set yt_thumbnail = drupal_image(video_hero_thumbnail_url, 'responsive_horizontal_card_image', responsive = true) %}

Steps to reproduce

  1. Add a video embed field to any content type.
  2. Navigate to "Manage Display" for that content type.
  3. In the format column select "Thumbnail" for the video embed field.
  4. You'll notice that only the image styles are available.
  5. We should include an option for the responsive image style as well.

Proposed resolution

I would like to propose the addition of a functionality that allows us to choose any responsive image style for the YouTube thumbnail. This enhancement would provide more flexibility and ensure a consistent visual experience across different devices.

✨ Feature request
Status

Active

Version

2.0

Component

Video Embed Field (base module)

Created by

πŸ‡΅πŸ‡°Pakistan shakilahmad Islamabad

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

Comments & Activities

Production build 0.69.0 2024