"Incompatible method signature with video_embed_field 3.x"

Created on 24 April 2025, 2 months ago

Problem/Motivation

The video_embed_brightcove module is incompatible with version 3.x of the video_embed_field module due to a method signature mismatch.

When attempting to embed a Brightcove video using video_embed_field 3.x, the following fatal error occurs:
Fatal error: Declaration of Drupal\video_embed_brightcove\Plugin\video_embed_field\Provider\Brightcove::renderEmbedCode($width, $height, $autoplay) must be compatible with Drupal\video_embed_field\ProviderPluginInterface::renderEmbedCode($width, $height, $autoplay, $title_format = null, $use_title_fallback = true)

This occurs because in video_embed_field 3.x, the `renderEmbedCode()` method signature in the `ProviderPluginInterface` has been updated to include two new parameters:
- `$title_format = NULL`
- `$use_title_fallback = TRUE`

These parameters support accessibility by allowing an iframe title to be set.

Steps to reproduce

1. Install video_embed_field 3.x
2. Install video_embed_brightcove
3. Attempt to embed a Brightcove video in a WYSIWYG editor
4. Observe the fatal error

This patch has been tested and resolves the compatibility issue without breaking existing functionality.

Proposed resolution

This patch updates the `renderEmbedCode()` method signature in the Brightcove provider to match the interface requirements from video_embed_field 3.x.

The patched code adds the missing parameters to make the method signature compatible while maintaining the original functionality.

📌 Task
Status

Active

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024