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

Add insert from URL option to the video block #4646

Closed
hypest opened this issue Mar 11, 2022 · 2 comments · Fixed by WordPress/gutenberg#41493
Closed

Add insert from URL option to the video block #4646

hypest opened this issue Mar 11, 2022 · 2 comments · Fixed by WordPress/gutenberg#41493
Assignees
Labels
[Pri] Medium [Type] Enhancement Improves a current area of the editor

Comments

@hypest
Copy link
Contributor

hypest commented Mar 11, 2022

Currently, there's no "Insert from URL" option for the Video block, but it's there for the Audio block.

The web version of Gutenberg has the option for the video block, and since it's in the mobile version for the Audio block, it makes sense to add it for the Video block as well.

@hypest hypest added the [Type] Enhancement Improves a current area of the editor label Mar 11, 2022
@mchowning
Copy link
Contributor

mchowning commented Mar 15, 2022

Seems like it would be worthwhile to also add this to the Image block since the web has it here too.

UPDATE: Turns out there's an issue for that: #3190

@derekblank
Copy link
Contributor

derekblank commented May 27, 2022

Currently working from remote branch: rnmobile/add-url-option-to-video-block.

A list of things this PR should include:

  • Tapping the Video block should display "Insert from URL" in the Media Options menu.
  • Inserting an invalid URL should notify the user that the URL is invalid (e.g., text input is just the word "google").
  • Inserting a valid video URL should display that video in the mobile video player.
  • Inserting an embeddable video URL (like a YouTube link) should invoke the Embed block.⁽²⁾

Caveats

  1. Further investigation may be needed to find an efficient solution for determining if a remote URL is a valid video. When an invalid video URL is given on the current web implementation, the Video block will still display the video player but will not display a notice to the user. (See video below.) If it is possible to determine the validity of a video with an efficient network request, we could take this a step further and display a notice to the user that the video URL is not valid. This is similar to how it is handled on the Image block. This could perhaps be done by only requesting the URL headers and checking the MIME type. There may be further caveats or edge cases here for special types of streaming-only URLs, like *.m3u8.

  2. There may be some further investigation/complexity when detecting whether or not a URL is embeddable, and switching to the Embed block. The web implementation may help serve as a guide with using createUpgradedEmbedBlock.

Gutenberg-Web-Video-Block-Invalid-URL.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] Medium [Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants