I’ve posted this issue on Gantry git and Grav Youtube plugin’s git about a month ago, but still haven’t received any answer.
So, I will have a try to post it here.
I don’t know to which side this bug relates: Plugin or Gantry, but they are related to each other.
Placing a short code like [youtube color=white autoplay=1]https://www.youtube.com/watch?v=BK8guP9ov2U[/youtube] into Gantry 5 Custom HTML particle is ignoring some options.
The Short Code processing is turned on (two checkboxes).
So, the youtube frame is loaded but it’s ignoring plugin’s options:
It ignores lazy load , Modest branding …
While plugin perfectly works placed in other markdown page.
I’ve tested it on fresh install of Grav 1.7.3, Gantry 5.4.36 and Helium 5.4.36.
Hm, as for example on a localhost I’ve placed this shortcode: [youtube color=red autoplay=1]https://www.youtube.com/watch?v=BK8guP9ov2U[/youtube]
As you see controls are still white, autoplay doesn’t work…
@01K, Ouch… didn’t pay attention to the ‘autoplay’ and ‘color’ properties…
Autoplay:
Did some Googling:
The reason seems to be because Google and other browsers have disabled autoplay because of the annoying abuse. They now only allow you to use autoplay when you mute the sound. The user will have to enable sound manually.
color This parameter specifies the color that will be used in the player’s video progress bar to highlight the amount of the video that the viewer has already seen. Valid parameter values are red and white , and, by default, the player uses the color red in the video progress bar. See the YouTube API blog for more information about color options.
White and red for the progress bar is working fine.
That’s strange because lazy-loading still doesn’t work. On other website the autoplay=1 without any additional parameters does work on another - doesn’t…
But it seems that I’ve found a solution: the [plugin:youtube]() code must be used to utilize all params.
But this doesn’t work in Custom HTML particle of Gantry5 It seems that Gantry doesn’t support such plugin call
Changed {{ particle.markdown|markdown }} to {{ particle.markdown|raw }}
But it still outputs plain text: [plugin:youtube](https://www.youtube.com/watch?v=xxx)