Lack of thumbnail dimensions breaks Drupal cron

Created on 10 January 2024, 6 months ago

Problem/Motivation

After installing this module and creating some JWPlayer remote media, Drupal's cron fails with this error:

Error: Typed property Drupal\jw_video_media_source\MediaFetcher::$thumbnailWidth must not be accessed before initialization in Drupal\jw_video_media_source\MediaFetcher->getThumbnailWidth() (line 447 of /code/modules/contrib/jw_video_media_source/src/MediaFetcher.php)

Proposed resolution

Ensure that values are assigned for $thumbnailWidth and $thumbnailHeight in the MediaFetcher.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom natts London

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

Comments & Activities

  • Issue created by @natts
  • πŸ‡¬πŸ‡§United Kingdom natts London

    Here's a patch which selects the first thumbnail returned by the API, and uses the width specified. Its height is not specified by the API, so this is calculated on the assumption that the video and thumbnail are using 16:9 aspect ratio.

  • Status changed to Needs review 6 months ago
  • πŸ‡¬πŸ‡§United Kingdom natts London
Production build 0.69.0 2024