-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Saving a Video block with a file URL displays placeholder text in the editor #42515
Comments
I took a look at this one, and believe the issue is due to this early return block before the render function that displays the MediaPlaceholder when no id is present:
Although the edit.native.js Video block file is setting the
Although the native file sets the
The lack of an id results in the display of the early return function in the native file, and perceived content loss for the user. I am not entirely sure why the web file is setting To preserve the web behavior and also eliminate the perceived content loss on mobile, one solution could be to modify the early return function to check for a src attribute as well. This change to the early return function logic appears to fix the issue:
I'll continue to investigate what else (if anything) this potential change might affect within edit.native.js. |
Great investigative work, @derekblank. It appears the web editor's conditional was refactored in #19162. Subsequently, the same logic in the native editor was refactored in #16331. The refactors are slightly different in regards to which attribute they rely upon — gutenberg/packages/block-library/src/video/edit.js Lines 142 to 145 in 4ed1c11
gutenberg/packages/block-library/src/video/edit.native.js Lines 239 to 242 in 4ed1c11
I wonder if we are able to align the conditionals so that they function the same upon each platform. I.e. both platforms check WDYT? |
Thanks for the further investigation, @dcalhoun. I agree that aligning the conditionals to check for |
This issue is resolved via #49858. |
Description
Saving a Video block that points to a raw file URL (e.g. a MP4 file, not a YouTube embed), the block's preview is removed as if the URL was not set. However, the file URL remains within the post's HTML content.
Step-by-step reproduction instructions
Expected behaviour
The Video block displays a preview of the video URL.
Actual behaviour
The Video block appears with a placeholder as if no URL is set.
Screenshots or screen recording (optional)
RPReplay_Final1658172366.MP4
WordPress information
Device information
The text was updated successfully, but these errors were encountered: