Hello folks,
i am currently working on a project and experiencing following issues with embedding external oembed youtube content:
Problem/Motivation
I want to give editors of my project the ability to add external youtube videos from their youtube account as a full width header slider. I got all set up: A configured media content type with the oembed youtube provider, a header field in my basic page and a view that uses blazy for the slider elements. The slider and all slider elements are working as expected and even my youtube video is being displayed correctly but i have big problems adding the youtube api parameters i need for a good user experience.
I simply add the parameters to the link of the remote video content, e.g.: https://youtu.be/VID_ID?param1¶m2
[...]
First take a look at the available parameters here: https://developers.google.com/youtube/player_parameters
I want to archieve following functionality:
Autoplay
-> working on my site with the "?mute=1&autoplay=1"
parameters
Loop
-> not working with the "?loop=1", "?playlist=VID_ID&loop=1" or "?version=3&playlist=VID_ID&loop=1"
parameters as suggested at https://developers.google.com/youtube/player_parameters#loop
Hide Controls
-> not working with the "?rel=0"
parameters.
Hide YouTube Account and video title
-> not working with the "?showinfo=0"
parameter
Hide "display similiar videos" at the end of the video
-> not working with "?rel=0"
parameter
I tried "&" between the parameters instead of just "&" as suggested on some issues on stackoverflow with no effect.
I also tried manipulating DOM and template files for manually appending the correct parameter to the youtube link but this seems to be not possible due drupals oembed security.
Steps to reproduce
1. Create remote media element with default youtube oembed provider
2. Create remote media content with youtube url + api parameters
3. display media content on basic page
I use following remote video URL for testing: https://youtu.be/J9r5RBkl-X0?version=3&playlist=J9r5RBkl-X0&autoplay=1&controls=0&disablekb=1&loop=1&rel=0&showinfo=0&mute=1
I hope someone experienced the same problem because i couldnt find anything on this particular problem.
Thanks in advance