enablejsapi for YouTube not adding param

Created on 3 October 2023, about 1 year ago

enablejsapi for YouTube not adding param to URL, even though it's being added to the $url_parts['query'] array

In Controller/OEmbedIframeController.php, Line 46, if the Provider="YouTube" it adds a param to the $url_parts['query'] array, enablejsapi=TRUE, which should result in &enablejsapi=1 being added to the iFrame URL for the Youtube video.


I confirmed via a debug statement that the $media_oembed_control['provider_name'] === 'YouTube', but my iFrame URL does not have &enablejsapi=1.


It's difficult to pin down why this isn't working and what might be conflicting with it, because I have used this module before on other projects and that enablejsapi parameter has worked before, same version 2.0.0-beta2. Discussed briefly with a maintainer and he thought perhaps it might have to do with Google tag manager being embeded into the iframe twig template.

Steps to reproduce

Here's a description of my setup, although the main point is to just render a Remote Video on the page, and is surely a simpler way to reproduce:

  1. Create a new paragraph type "Video Item", with an entity reference field allowing Media of type "Remote Video"
  2. Create a new paragraph type "Video Paragraph" with an entity reference field, allowing Paragraph references of type "Video Item"
  3. Create a content type with an entity reference field (e.g., "Media Items") allowing referencing paragraphs of type "Video Paragraph"
  4. Create a new node of that content type add a "Video Paragraph" to the Media Items field of type Remote Video with a Youtube URL, https://www.youtube.com/watch?v=EngW7tLk6R8, then render that field on the page using twig: {{ content.field_media_items }}
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlinnetz

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

Comments & Activities

Production build 0.71.5 2024