Created on 14 January 2021, almost 4 years ago
Updated 20 May 2024, 6 months ago

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',
      ],
✨ Feature request
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France creatile

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024