-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Video block: Video is not displayed when post is saved in the web version #30987
Video block: Video is not displayed when post is saved in the web version #30987
Comments
On Android, it produces a block validation error when testing with a debug build (see attached screenshot). I saw that we already have an issue, in this case related to the Cover block, that shows a similar error, maybe both issues are caused by the same problem 🤔 . |
Thanks for the investigation you did here @fluiddot so I can confirm what you have suggested. On the web, it seems the video content of the blocks is converted to an embed hence the failure. An initial idea, I had was to utilize the Below is how the Video block looks as an Embed block, and it also shows that it's not playable in the mobile app due to the missing
A solution to this may be to create a rollback mechanism on mobile that replaces the Embed blocks in |
Good catch 🎊 !
I'm wondering why the
Yeah, that's a good option although we should investigate potential side effects. |
Interesting. That's a hypothesis worth checking out. 👍🏾 |
To tie up all the pieces to this I've found in my investigations so far: I've only been able to reproduce this behaviour on WP.com sites or sites connected to the Jetpack plugin (with VideoPress enabled). Videos uploaded to self-hosted sites without any plugins that automatically change the video block, like VideoPress, displayed as expected within the app. There's an older issue related to this here, also, that outlines some discussions and possible solutions, particularly in this comment: wordpress-mobile/gutenberg-mobile#1152 There are also some other related issues that may be resolved by addressing this, such as wordpress-mobile/gutenberg-mobile#3292. I'm planning to look into recreating the PR in #15674 to improve the way unsupported blocks are handled. |
I'm re-opening the issue as I managed to reproduce a similar issue to this one when testing version 24.0. I tested previous versions (from 24.0 to 23.5) and can also be reproduced in old versions. No error is displayed within the Video block but it's rendered as empty (see attached video capture). ios-video-block-empty.MP4 |
I noticed that this regression was introduced in this change #49858. After further investigations, I checked the following cases and found two scenarios for the condition: gutenberg/packages/block-library/src/video/edit.native.js Lines 239 to 242 in 3f010e6
ScenariosVideo uploaded (hosted in VideoPress)
Video from media library:
Video from URL
Video uploaded from the web (hosted in VideoPress)
Post created in the app and saved on the web with videos (hosted in VideoPress)
is converted to:
NOTE: It also transforms Video blocks that point to media URLs (e.g.
Conditions
I'll open a PR with a temporary workaround, as the VideoPress case, should not be handled in the core block. |
Description
This issue was initially identified here: wordpress-mobile/WordPress-iOS#15184
When a video block is saved in the web version then the video can't be displayed in the mobile app and shows the message “Problem displaying block” within the block. Looks like there's some kind of incompatibility on the HTML produced when this block is used in the mobile app and web.
Step-by-step reproduction instructions
The steps for reproducing it are:
NOTE: This issue can be also reproduced by adding a video block in the web version and then opening the post in the mobile app.
As an example, here is the HTML produced in each case:
Native app (WPiOS)
Web
When opened first time with code editor:
When opened with visual editor:
In this case the web version generates a preview, maybe this is related to why it produces a different HTML code.
Expected behaviour
The video should be displayed in the mobile app.
Actual behaviour
The video is not displayed in the mobile app.
Screenshots or screen recording (optional)
WordPress information
Device information
The text was updated successfully, but these errors were encountered: