Browser: Chrome 110
OS: macOS
I’m using Vimeo videos on a website, but for some reason the fullscreen button is missing even though it’s enabled in Vimeo. Can you check what’s causing this?
I had to add this code to enable it.
add_filter( 'bricks/element/render_attributes', function( $attributes, $key, $element ) {
if ( $key !== 'iframe' ) {
return $attributes;
}
if ( ! is_object( $element ) || empty( $element->name ) || $element->name !== 'video' ) {
return $attributes;
}
$settings = isset( $element->settings ) && is_array( $element->settings ) ? $element->settings : [];
if ( ( $settings['videoType'] ?? '' ) !== 'vimeo' ) {
return $attributes;
}
if ( ! isset( $attributes['iframe'] ) || ! is_array( $attributes['iframe'] ) ) {
$attributes['iframe'] = [];
}
$attributes['iframe']['allow'] = [ 'autoplay; fullscreen; picture-in-picture; encrypted-media' ];
$attributes['iframe']['allowfullscreen'] = '';
return $attributes;
}, 10, 3 );