Gutenberg-mobile: Videos added/edited on the web don't load in mobile editor

Created on 18 Jun 2019  Ā·  12Comments  Ā·  Source: wordpress-mobile/gutenberg-mobile

  1. On the web, create a post and add a video block. (I added a video already uploaded to the site's media library.)
  2. Save the draft.
  3. In the app, open the draft post.

Expected: The video blocks will load (or at least the video block with no caption will load).
Actual: The error ā€œProblem displaying blockā€ appears instead for both blocks.

image

Saving the post in the app and trying to open it again on the web results in an error on that end: ā€œThis block contains unexpected or invalid content.ā€

image

I also confirmed that the same ā€œProblem displaying blockā€ error occurs if I add a video in the app, open the draft on the web and save it there, and then reopen the video in the app. There seems to be an issue between how Gutenberg web saves the video block markup and how Gutenberg mobile expects it to be.

Tested on iPhone XS, iOS 12.3.1, WPiOS 12.7.0.20190617

[OS] Android [OS] iOS [Type] Bug

All 12 comments

This issue occurred on a WordPress.com Simple site with the Premium plan. @pinarol let me know that there's a known issue with how the video block code is handled for sites on that plan (internal ref: pafL3P-pg-p2), which is the likely cause for both problems I saw.

Hi @rachelmcr,

I would split this problem into 2 parts.

  1. The reason why we are showing: "Unsupported block type" is this: pafL3P-pg-p2 #comment-1712

@hypest is ā¬†ļøagreement still ok for us?

  1. Mobile shouldn't be changing the content of that block in that scenario (which results in invalid content on the web). This one needs to be examined and I will take a look at it.

cc: @frosty

This issue is also reproducible on Android devices. I have found the root cause of the problem.
It seems that mobile apps are changing the <--wp:video... content.

Screen Shot 2019-06-27 at 5 45 52 PM

Hey @rachelmcr @frosty, just to let you know that it's a known issue and it doesn't have high priority
pafL3P-pg-p2 #comment-1720

Re-tested and confirmed with 13.5-rc-1 that video blocks added using Calypso Gutenberg do not load in Gutenberg Mobile with error "Problem displaying block" and confirmed that the precursor block comment code is changed after viewing the post in the app—the guid and src attributes go missing.

On the web:

<!-- wp:video {"guid":"Kb3sKmpL","id":54,"src":"https://aboutmakingmoviesmovie.files.wordpress.com/2019/10/59372044362__e5d32d89-e607-49a8-94b3-03ed7a014063.mov"} -->

In the app:

<!-- wp:video {"id":54,"className":"wp-block-embed is-type-video is-provider-videopress"} -->

Screenshot_20191024-135618 Screenshot_20191024-135628
Tested with WPAndroid 13.5-rc-1 on Pixel 3 Android 10.

Screen Shot 2019-10-24 at Oct 24 1 54 58 PM Screen Shot 2019-10-24 at Oct 24 1 55 03 PM
Tested with Gutenberg Calypso on Chrome 77.0.3865.120 on macOS 10.14.6.

Updating to say we were contacted about this by a user in #2900144-zen

Looking into this it appears that SimpleSites on a premium plan are creating video blocks with the following pattern which wraps the video URL in a div and was causing a block registration error in addition to removing the GUID parameter:

<!-- wp:video {"autoplay":true,"guid":"7IeP9E0R","id":34,"loop":true,"muted":true,"src":"https://chipsnyder.files.wordpress.com/2020/06/img_0029.mov"} -->
<figure class="wp-block-video wp-block-embed is-type-video is-provider-videopress"><div class="wp-block-embed__wrapper">
https://videopress.com/v/7IeP9E0R?autoPlay=true&amp;loop=true&amp;muted=true&amp;persistVolume=false&amp;preloadContent=metadata
</div></figure>
<!-- /wp:video -->

Where an atomic site I'm using produces this syntax which wraps the URL in a video tag:

<!-- wp:video {"autoplay":true,"id":608,"loop":false,"muted":false,"playsInline":false,"src":"https://testeisbardev.wpcomstaging.com/wp-content/uploads/2020/04/60686287497__6ff2dbfc-6c7f-4ae0-8e54-992daf76849a-1.mov"} -->
<figure class="wp-block-video"><video autoplay controls src="https://testeisbardev.wpcomstaging.com/wp-content/uploads/2020/04/60686287497__6ff2dbfc-6c7f-4ae0-8e54-992daf76849a-1.mov"></video></figure>
<!-- /wp:video -->

I'm currently working on revisiting the block registration to handle these cases.

Describing the issue helped me better understand @marecar3 comment here:

The reason why we are showing: "Unsupported block type" is this: pafL3P-pg-p2 #comment-1712

I'll sync up with him to see if there are any options to prevent the apps from overwriting what the web has.

As for the issue here for people like me who may have overlooked it. This configuration results in a jetpack/vaultpress block instead of a core/video block even though the code in the editor appears the same. To add support for this type Gutenberg would need to add support for Jetpack blocks.

After discussing some options with others it looks like support for this is being tracked by https://github.com/Automattic/jetpack/issues/12358 and work is underway to better handle the case when the block fails validation https://github.com/WordPress/gutenberg/pull/15674.

The work that's being done in the parser should help provide a better experience

After discussing some options with others

šŸ‘‹ @chipsnyder, can you expand on the options discussed, or link me to related convos? I'm thinking, now that we have the ability to separate .com from .org code, maybe we can address this by incorporating the "Jetpack" side block too.

Hey @hypest. I think there are some internal documents that capture parts of these options but I'm failing to uncover a combined explanation.

  1. Make some changes to apply the guid formatting to the generated block more details here: pafL3P-pg#comment-1719
  2. Add support for jetpack/vaultpress

    • This seems like the best option now that we have started added Jetpack Support in GBM

    • If memory serves me correctly this is what was decided on because at the time we hadn't added Jetpack support to GBM yet but we were working on it.

  3. Modify Jetpack to use a different registration for the block like jetpack/vaultpress instead of core/video

    • This seems like it will have a lot of rippling consequences.

Ps. There is worked started that seems to be going down the path of (3) mentioned here however that work seems to have stalled. Here is the PR and Issue I'm referring to:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamthomasbishop picture iamthomasbishop  Ā·  3Comments

etoledom picture etoledom  Ā·  4Comments

designsimply picture designsimply  Ā·  4Comments

mkevins picture mkevins  Ā·  3Comments

pinarol picture pinarol  Ā·  4Comments