Comments

rich.yumul created an issue. See original summary.

rich.yumul’s picture

rich.yumul’s picture

Status: Active » Needs review
goldlilys’s picture

This works for me and you can do the same for the mute parameter to mute the video by default.

johnnydarkko’s picture

Version: 7.x-2.0-beta11 » 8.x-2.x-dev
StatusFileSize
new23.9 KB

Rerolling for 8.x-2.x.
Instead of using the loop parameter for youtube, I set the playlist parameter to the same video ID which results in a loop.
This patch also includes the addition of the loop parameter for vimeo: https://help.vimeo.com/hc/en-us/articles/115004485728-Autoplaying-and-lo...

johnnydarkko’s picture

Added loop parameter to the youtube embed code. It was only playing the video twice without the loop parameter.

johnnydarkko’s picture

Added configs for the loop feature.

anybody’s picture

vdenis’s picture

Tested patch locally and works as described!

Good job!

aldunchev’s picture

Thanks for the patch. However there is one issue(maybe is good idea to move it as a separate issue ): on chrome the video won't play if it is not muted. Basically chrome is blocking autoplay videos and so the loop parameter does not work either.

jan kellermann’s picture

I have extended the patch and added mute-, controls- and rel-parameter (but without tests, sorry).

A better solution is to change the parameters for renderEmbedCode to ($width, $height, $settings) with $settings as array. But this should decide the module-maintainer.

kevinfunk’s picture

I have extended the patch even more to add "Autoplay for Admin" since the admin role has the permission "Never autoplay videos." Does anyone have a better idea of how to hand this?

siavash’s picture

Great Patch! I think this is a major issue on the stable version currently.

Everything seems to be working good other than the 'Autoplay for Admins' option. User 1 is still not getting the autoplay feature.

siavash’s picture

2 more attributes that would be helpful here for background videos:
autohide=1
showinfo=0

tostinni’s picture

A little warning on this patch, it's creating a breaking API change by modifying ProviderPluginInterface which will break all third party video provider modules.

It will generate error like this one :

Fatal error: Declaration of Drupal\video_embed_dailymotion\Plugin\video_embed_field\Provider\Dailymotion::renderEmbedCode($width, $height, $autoplay) must be compatible with Drupal\video_embed_field\ProviderPluginInterface::renderEmbedCode($width, $height, $autoplay, $loop, $mute, $controls, $rel) in /var/www/drupal/web/modules/contrib/video_embed_dailymotion/src/Plugin/video_embed_field/Provider/Dailymotion.php on line 18
anybody’s picture

Same major problem here as written in #15!

anybody’s picture

Status: Needs review » Needs work
anybody’s picture

I think the best fix would be to simply forward the parameters to the template like this, so the themer can decide if to use them:

 /**
   * {@inheritdoc}
   */
  public function renderEmbedCode($width, $height, $autoplay, $loop, $mute, $controls, $rel) {
    // @todo: test with colorbox formatter.
    return [
      '#theme' => 'video_embed_html5',
      '#src' => $this->videoUrl,
      '#type' => 'video/' . $this->videoType,
      '#width' => $width,
      '#height' => $height,
      '#autoplay' => $autoplay,
      '#loop' => $loop,
      '#mute' => $mute,
      '#controls' => $controls,
      '#rel' => $rel,
      '#provider' => 'local_html5',
    ];
  }
anybody’s picture

re#15: If you use this patch and use video_embed_html5 you need this patch: #3159736: Youtube looping (#2866001): Html5::renderEmbedCode parameters not compatible with ProviderPluginInterface::renderEmbedCode!

So it's true, it breaks dependent modules!

sam152’s picture

Status: Needs work » Closed (won't fix)

With the advent of Media in core, the Video Embed Field module has moved to being minimally maintained. Only issues which assist in the migration to Media in core will be committed. To read more about this decision, please see: #3089599: Maintenance status for Video Embed Field now that media is in core.

prem suthar’s picture

Re Roll Patch # 12 by hide The Controls For Viemo Player also.

prem suthar’s picture

StatusFileSize
new28.87 KB

By Mistake change the Get Form Code Remove that Code.#21