Youtube playlist error because of incorrect regex

Created on 17 March 2025, about 1 month ago

Problem/Motivation

Providing a Youtube playlist URL (for example https://www.youtube.com/playlist?list=PLbpi6ZahtOH6PVhBTPhS6iDUkFGJBeH9g) does not work. The error "Could not find a video provider to handle the given URL" is thrown.

The source of the problem is the regex in \Drupal\video_embed_field\Plugin\video_embed_field\Provider\YouTubePlaylist::getUrlComponent. The regex searches for "/watch?" but not "/playlist?". Both are valid. The difference is that "/watch?" will autoplay.

Additionally but unrelated, there are a couple incorrect implementations of \Drupal\video_embed_field\ProviderPluginInterface::renderEmbedCode that are missing arguments which throw errors such as: "Fatal error: Declaration of Drupal\video_embed_echo360\Plugin\video_embed_field\Provider\Echo360::renderEmbedCode($width, $height, $autoplay) must be compatible with Drupal\video_embed_field\ProviderPluginInterface::renderEmbedCode($width, $height, $autoplay, $title_format = null, $use_title_fallback = true) in /app/docroot/modules/custom/video_embed_echo360/src/Plugin/video_embed_field/Provider/Echo360.php on line 20".
These are fatal errors that cause the page to not load.

Steps to reproduce

Enter "https://www.youtube.com/playlist?list=PLbpi6ZahtOH6PVhBTPhS6iDUkFGJBeH9g" in a video embed field.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States maskedjellybean Portland, OR

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024