Html::video( $url, $options, $attr ) — options array won't be used as query params in the embed URL

Hello,

I’m trying to use Html::video but cannot figure out how to set the options properly.

Html::video(string $url, array $options = [ ], array $attr = [ ]): string|null

According to the documentation the $options array should let me add vimeo and youtube options, which will be used as query params in the embed URL.

But:

<?php

$options = ['background'=>'1']; // this does not change the embed url

$options = ['background'=>true]; // neither does this

$options = ['background=1']; // neither does this

$url .= '?background=1'; // this works, but I would prefer to use $options array

?>

<?= Html::video( $url, $options, $attr ) ?>

Ok, sorry I already figured it out:

YouTube and Vimeo need individual arrays, which are nested in the $options array


<?php 

$optionsVimeo = [
	'background' => true,
];

$options = array(
	'vimeo' => $optionsVimeo,
);

?>

<?= Html::video( $url, $options, $attr ) ?>

Looking into the video function lead me to this.

I feel like this is worth noting in the documentation.