Problem/Motivation
Youtube videos won't autoplay unless you configure sound to mute
Steps to reproduce
In field display, you can configure autoplay and responsive option
Proposed resolution
I propose to add a checkbox with mute option or simply add 'mute' => '1' in case autoplay is checked
This code is visible in src/plugin/video_embed_field/Provide/YouTube.php
public function renderEmbedCode($width, $height, $autoplay) {
$embed_code = [
'#type' => 'video_embed_iframe',
'#provider' => 'youtube',
'#url' => sprintf('https://www.youtube.com/embed/%s', $this->getVideoId()),
'#query' => [
'autoplay' => $autoplay,
'start' => $this->getTimeIndex(),
'rel' => '0',
'mute' => '1',
],
Comments
Comment #2
naveenvalechaComment #3
kevinn commentedYour patch is forcing mute, i created a patch where mute is enabled if autoplay is.
Comment #6
bobi-mel commentedThe patches #2 and #3 can't be applied for D10. I added a new patch and created the MR.
Comment #7
o_timoshchuk commentedI checked the patch #6 and it worked for me
Comment #9
nicxvan commentedSimplified the patch a bit.
Comment #10
nicxvan commentedComment #13
mably commentedComment #16
nicxvan commented