Skip to content
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

VideoPress: allow users to upload videos from Gutenberg [2] #11194

Closed
mmtr opened this issue Jan 24, 2019 · 4 comments · Fixed by #13682
Closed

VideoPress: allow users to upload videos from Gutenberg [2] #11194

mmtr opened this issue Jan 24, 2019 · 4 comments · Fixed by #13682
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] VideoPress A feature to help you upload and insert videos on your site. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack

Comments

@mmtr
Copy link
Member

mmtr commented Jan 24, 2019

Steps to reproduce the issue

  1. Start from a Jetpack site with an active Professional upgrade.
  2. Go to Jetpack > Settings, and enable the VideoPress feature.
  3. Go to Post > Add new.
  4. Insert a video block.
  5. Upload a video using the "Upload" button.
  6. Save / publish / discard the post.
  7. Go to Media > Library and check the video previously uploaded.

What I expected

The video is processed by VideoPress.
screen shot 2019-01-24 at 15 42 33

What happened instead

The video has not been processed by VideoPress.
screen shot 2019-01-24 at 15 42 13

@mmtr mmtr added [Feature] VideoPress A feature to help you upload and insert videos on your site. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack labels Jan 24, 2019
@mmtr
Copy link
Member Author

mmtr commented Feb 25, 2019

Relevant discussion in p9dueE-xm-p2.

Uploading videos with the Media Library
Note that the issue is specific to the “Upload” button. Videos uploaded through “Media Library” are transcoded without any problem.

This is a good indicator of what is going on. So let’s start analyzing how Jetpack uploads videos when using the Media Library.

The VideoPress module enqueues some scripts when it detects we are in a page where we can upload files (#). These scripts changes how plupload creates new media items (plupload is the file uploader library used in the media modal).

Specifically, it makes an extra AJAX call when we select a video (#) for retrieving a token and a /rest/v1.1/sites/:site/media/new URL (#) that are used as an authorization header and as the new upload URL (#).

In other words, videos are uploaded by making a request to https://public-api.wordpress.com/rest/v1.1/sites/:site/media/new that is authenticated with a X_UPLOAD_TOKEN token.

That means that we’re actually creating the new media items in WordPress.com.

The real issue: /wp/v2/media endpoints
Going back to original issue, what happens when we select a file using the “Upload” button? Gutenberg creates new media items using the /wp/v2/media endpoint.

Since the request is to the self-hosted site (https://example.com/wp/v2/media) and we don’t have in place any logic for handling these uploads, the video is not transcoded.

@abcxyz-m
Copy link

abcxyz-m commented May 17, 2019

I've updated this support doc to remove references to the Video block, until this is addressed:

I've updated this support doc to note that you cannot upload via the Video block until this is addressed:

We should revert these changes to our user-facing documentation once this issue has been addressed.

Edit to add: Follow up in 2038608-zen once this is fixed.

@matticbot matticbot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label May 17, 2019
@tmmbecker
Copy link

confusion about this reported in 2084562-zen

@kwight
Copy link
Contributor

kwight commented Aug 30, 2019

Likely related to #7073.

@mmtr mmtr self-assigned this Sep 3, 2019
@gwwar gwwar changed the title VideoPress: allow users to upload videos from Gutenberg VideoPress: allow users to upload videos from Gutenberg [2] Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] VideoPress A feature to help you upload and insert videos on your site. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack
Projects
None yet
5 participants