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

Site Editor Compatibility: Podcast Player block issues in editor and front end views #19483

Closed
andrewserong opened this issue Apr 9, 2021 · 6 comments · Fixed by #19578 or #20193
Closed
Assignees
Labels
[Block] Podcast Player [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg [Type] Bug When a feature is broken and / or not performing as intended

Comments

@andrewserong
Copy link
Member

In the new site editor in Gutenberg (/wp-admin/admin.php?page=gutenberg-edit-site), there are some issues with the Podcast Player block within the editor and on the front end of the site. The issues include:

  • Within the editor, the styling and behaviour for the player doesn't appear to be rendering (perhaps an issue with how the block works with the site editor iframe?)
  • On the front end of the site, the player itself isn't being rendered / loaded

Steps to reproduce the issue

  1. Grab an RSS feed from your favourite podcast (here's one for Distributed.blog: https://distributed.blog/category/podcast/feed/)
  2. With the Gutenberg plugin active (>=10.4.0-rc1), activate a block-ready theme (like tt1-blocks)
  3. In the site editor, insert a Podcast Player block into the Footer template part
  4. Add the feed URL from your favourite podcast and click embed
  5. Observe that the player isn't rendered correctly.
  6. Save the template part and view the front end of your site
  7. Observe that the podcast player interface isn't loaded / rendered

What I expected

  • The player to be available within the editor canvas and to be styled correctly.
  • The player to be available on the front end of the site
Editor view Front end view
image image

What happened instead

  • The player is not available within the editor canvas
  • The player was not rendered on the front end of the site
Editor view Front end view (note missing player)
image image
@andrewserong andrewserong added [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Type] Bug When a feature is broken and / or not performing as intended [Block] Podcast Player [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg labels Apr 9, 2021
@ramonjd ramonjd self-assigned this Apr 19, 2021
@ramonjd
Copy link
Member

ramonjd commented Apr 21, 2021

It looks like podcast player enqueues assets from the mediaelement core lib: https://github.com/WordPress/WordPress/tree/master/wp-includes/js/mediaelement

So we're going to need a way to ensure all block dependencies can be copied into the site editor context.

I'm starting to think core should be offering a solution to this.

@sdixon194
Copy link
Contributor

I just did some more testing in preparation for the 9.9 release, but it looks like this issue is happening for me again 🤔 @ramonjd would you be able to take another look?

@sdixon194 sdixon194 reopened this Jun 25, 2021
@ramonjd
Copy link
Member

ramonjd commented Jun 28, 2021

I just did some more testing in preparation for the 9.9 release, but it looks like this issue is happening for me again 🤔 @ramonjd would you be able to take another look?

Thanks for the ping @sdixon194

Could you fill me in on how you tested this?

I just checked with release candidate (9.8.1-918672803-g67226f6) and bleeding edge (9.9-alpha-974918035-gf25064c), and embedding the podcast player block works as expected on the site editor and frontend end (using Gutenberg 10.9.1)

Screen Shot 2021-06-28 at 12 42 37 pm

Edit: Working okay in Atomic, but in WPCOM I do see this:

Screen Shot 2021-06-28 at 12 54 02 pm

I'll try to debug. It was working when we tested, honest! :D

@ramonjd
Copy link
Member

ramonjd commented Jun 28, 2021

As far as I can tell, the Site Editor in WPCOM is no longer loading mediaelement-css and wp-mediaelement-css, which are required for the podcast player to function correctly.

I'm not yet sure when or how this changed as we tested in WPCOM at the time and it was working.

My only guess is that it's due to a Gutenberg change, but I can't be sure. Still looking...

wp_enqueue_style( 'wp-mediaelement' ); is being called in the podcast-player.php

🤷

@ramonjd
Copy link
Member

ramonjd commented Jun 28, 2021

Okay, I think it's because we haven't implemented the changes required by WordPress/gutenberg#31873, which was merged after our changes.

We need to add 'style' => 'wp-mediaelement', to the register_block function.

Now it works

Screen Shot 2021-06-28 at 2 43 16 pm

cc @glendaviesnz for sanity check

Edit: So I think the solution is to add that line, since WPCOM is running the required Gutenberg version (10.9.1) in order for it to work. It looks like we can roll back the workaround in maybeCopyElementsToSiteEditorContext for WPCOM at least, but for sites running previous versions of Gutenberg that support site editor, we may want to leave it in until we can fully test.

Leaving in maybeCopyElementsToSiteEditorContext shouldn't affect WPCOM as the method checks to see if the enqueued asset id is present before trying to add it in again.

@sdixon194
Copy link
Contributor

Brilliant, nice sleuthing and thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Podcast Player [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
4 participants