Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing wrapper element / inconsistent markup with other WP embeds #165

Open
cameronterry opened this issue Jun 26, 2020 · 0 comments
Open

Comments

@cameronterry
Copy link

Describe the bug

Please accept my apologies if this already achieveable through a setting or is reported elsewhere. I have looked in the code and in the repo for some thing similar, but I could have missed it.

On a current project, we have had to introduce a workaround to the codebase for the lack of wrapper element from Brightcove video block in Block Editor powered content. When the Brightcove video is added to the page, it merely adds the embed <iframe> player to the page.

The following is the snippet we used as a workaround;

function brightcove_video_wrapper( $block_content = '', $block = [] ) {
	if ( 'bc/brightcove' === $block['blockName'] ) {
		$block_content = sprintf( '<div class="wp-block-brightcove">%1$s</div>', $block_content );
	}

	return $block_content;
}

This lack of container element means handling responsiveness related work in the theme more difficult.

In addition, this workaround resolves adjusting the Brightcove player to fit the public-facing side of the website. The lack of container also means that the WordPress admin experience can be less than optimal as well, as there is no clean and effective way to match a selector to the Brightcove video.

Steps to Reproduce
N/A

Expected Preferred behavior

As Brightcove video player is an additional embed option, I believe it would be beneficial if markup similar to YouTube and other embeds was adopted in both the WP Admin and public-facing sides.

Some thing akin to;

<figure class="wp-block-embed-brightcove wp-block-embed is-type-video is-provider-brightcove wp-embed-aspect-16-9 wp-has-aspect-ratio">
    <div class="wp-block-embed__wrapper">
        <!-- brightcove video embed here -->
    </div>
</figure>

This would be make adjusting the Brightcove video player to match the responsiveness of the website much simpler and provide opportunities to ensure the experience of the Brightcove block can be adjusted for Block Editor in WP Admin.

Environment information

  • WordPress version: 5.4.2
  • Not using the official Gutenberg plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants