Thumbnail not found on verion 2.1x-dev

Created on 27 March 2024, 3 months ago
Updated 26 April 2024, 2 months ago

Problem/Motivation

We updated to version 2.1x as it allow us to get the best quality thumbnail available, but the template always shows the sd version.

Steps to reproduce

We updated to version 2.1.x
Enabled the oembed_lazyload_youtube.
Adding a media remote video with the widget youtube lazyload.
Enable the settings "Enable advanced resource fetching controls" on /admin/config/media/oembed-lazyload
Enable settings "Prefer maximum image resolution" on "/admin/config/media/oembed-lazyload/youtube"

But the thumbnail is not available.

We debug the YoutubeEnhancer class, and the right thumbnail is saved on the data variable, but it is not changed on the template.


        foreach (static::THUMBNAIL_RESOLUTIONS as $format => $resolution) {
          $thumbnail_url = "https://i.ytimg.com/vi_webp/$embed_code/$format.webp";
          try {
            $response = $this->httpClient->request(
              'get',
              $thumbnail_url,
              [RequestOptions::TIMEOUT => 5],
            );
            if ($response->getStatusCode() === 200) {
              $data['thumbnail_url'] = $thumbnail_url;
              $data['thumbnail_width'] = $resolution['width'];
              $data['thumbnail_height'] = $resolution['height'];
              break;
            }
          }
          catch (ClientException $e) {
            // Probably a 404 - ignore it, as it's expected.
          }
πŸ› Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain Eduardo Morales Alberti Spain, πŸ‡ͺπŸ‡Ί

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

Comments & Activities

Production build 0.69.0 2024