Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 797 forks source link

VideoPress: Dragging and dropping video into Cover block to upload throws errors #36258

Open laurelfulford opened 6 months ago

laurelfulford commented 6 months ago

Impacted plugin

VideoPress

Quick summary

The Block editor lets you drag media like images and videos directly into certain blocks in the editor to upload them to the media library.

When you have VideoPress enabled on a site, and drag a video into the cover block in the editor, the video doesn't load and the browser throws an error.

Steps to reproduce

  1. Start on a self-hosted or Atomic site with Jetpack and VideoPress enabled.
  2. Create a new page, and add a Cover block.
  3. Drag a video from your computer into the Cover block to upload.

A clear and concise description of what you expected to happen.

I expected the video to be uploaded to the media library, and preview in the editor.

What actually happened

The video is not uploaded. Sometimes (but not always), an error (invalid JSON response or "you are probably offline") would display in the editor.

A couple errors also appear in the console:

post.php:1 Access to fetch at 'https://public-api.wordpress.com/rest/v1.1/sites/230270056/media/new?locale=en_US&_locale=user' from origin '[removed URL]' has been blocked by CORS policy: Request header field x-wp-api-fetch-from-editor is not allowed by Access-Control-Allow-Headers in preflight response.

and

POST https://public-api.wordpress.com/rest/v1.1/sites/230270056/media/new?locale=en_US&_locale=user net::ERR_FAILED

Uploading the video to the media library first works as expected.

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

github-actions[bot] commented 1 week ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.