Darginec05 / Yoopta-Editor

Build Notion-like, Craft-like, Coda-like, Medium-like editors with Yoopta
https://yoopta.dev/
MIT License
1.09k stars 86 forks source link

[BUG] Unable to handle unlisted video from Vimeo using embed or video plugins #269

Open filipholec opened 2 weeks ago

filipholec commented 2 weeks ago

Has this bug been raised before?

Description

It's not easy to render video from Vimeo provider when using video or embed plugins.

Structure of vimeo video link:

Unlisted videos without hashId part would show access denied on a video.

Video plugin

Public videos (without hash part) can be easily inserted using video plugin, however, there is issue with unlisted videos. There is no processing of hashId part, so the video will result in access denied.

Moreover, for processing of Vimeo videos, there is used deprecated Simple API which might not work with unlisted videos. Instead of 'https://vimeo.com/api/v2/video' endpoint, it is recommended to use oEmbed API.

Embed plugin

For this part, I'll demonstrate using the following links / elements:

Both public and private videos cannot be embedded using classic iframe (there is type error with URL parsing in console): image

With embed links, the issue is with custom processing of vimeo videos - it creates request to API that is not valid and returns an error: image

However, there is a hacky way how to bypass processing of Vimeo videos - replace vimeo.com with VIMEO.com in the link and it works just fine. Example using the link https://player.VIMEO.com/video/1004459764?h=db62233a97: image

For the time being, we'll be using this hack, but it would be great if this would be approached in the upcoming releases :slightly_smiling_face:

In the embed plugin, the obsolete Simple API that is deprecated from Vimeo's side is used and developers should use their oEmbed API:

Also, my question is - embed with link works without using any custom processing, so why do you have custom Vimeo processing in Embed plugin to handle vimeo videos?

Steps to Reproduce

All relevant information is in the description.

Environment

Screenshots

No response

Do you want to work on this issue?

No

If "yes" to above, please explain how you would technically implement this

No response

EDIT: Updated format of links

Darginec05 commented 2 weeks ago

@filipholec you deserve credits for such detailed description 🎉 👯 Thanks for reporting issue, I'll take a look