wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.66k stars 1.11k forks source link

When editing a post, loading a version from another device fails to load video #15184

Closed startuptester closed 5 months ago

startuptester commented 3 years ago

Expected behavior

All blocks should load properly when editing from another device

Actual behavior

If I add a video block to a post and then view it in preview on another device, I will get this message when I return to the app to edit: image If I select, “From this device”, everything is fine. But if I choose “From another device”, I get:

Steps to reproduce the behavior

1) Add a video block to a post 2) view it in preview on another device 3) When you get this message: image Select, “From this device” Result: everything is fine But if you choose “From another device”: image

Tested on iPhone 12 Pro, iOS 14.1, WPiOS 16.0.0.3
fluiddot commented 3 years ago

I didn't manage to reproduce it with two devices using the WPiOS app, however it happened to me when using the web version. Looks like there's some kind of incompatibility on the HTML produced in video blocks when they're used in the native app and web.

The steps for reproducing it are:

  1. In the app
    1. Create/edit a post
    2. Add a video block
    3. Insert a video
    4. Save the post
  2. In the web
    1. Open the post
    2. Observe that the HTML code is different when changing to code editor
    3. Save the post
  3. In the app again
    1. Open the post
    2. Observe that the video block shows an error

As an example, here is the HTML produced in each case:

Native app (WPiOS)

<!-- wp:video {"id":<MEDIA_ID>} -->
<figure class="wp-block-video"><video controls src="<VIDEO_SRC>"></video></figure>
<!-- /wp:video -->

Web

When opened first time with code editor:

<!-- wp:video {"autoplay":false,"id":<MEDIA_ID>,"loop":false,"muted":false,"src":"<VIDEO_SRC>"} -->
<figure class="wp-block-video"><video controls src="<VIDEO_SRC>"></video></figure>
<!-- /wp:video -->

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.

<!-- wp:video {"autoplay":false,"guid":"<VIDEO_GUID>","id":<MEDIA_ID>,"loop":false,"muted":false,"src":"<VIDEO_SRC>","videoPressClassNames":"wp-block-embed is-type-video is-provider-videopress"} -->
<figure class="wp-block-video wp-block-embed is-type-video is-provider-videopress"><div class="wp-block-embed__wrapper">
https://videopress.com/v/<VIDEO_GUID>?preloadContent=metadata
</div></figure>
<!-- /wp:video -->

Tested on iPhone 11, iOS 14.2, WPiOS 17.0 (17.0.1.0).

fluiddot commented 5 months ago

I couldn't manage to reproduce this issue in version 24.7. Most likely it has been fixed via https://github.com/WordPress/gutenberg/issues/30987, so we can close it.