Vimeo embed URLs parsed incorrectly in email

Vimeo provides two types of urls: direct links (https://vimeo.com/508864124/fcbbcc92fa) and embed links (which can be used in an iframe, but won’t work if clicked directly)

For example:

<iframe src="https://player.vimeo.com/video/508864124?h=fcbbcc92fa" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
  1. When this is sent as a notification email, the direct link appears correctly, but the iframe is replaced into a link with the wrong URL: https://vimeo.com/508864124?h=fcbbcc92fa instead of https://player.vimeo.com/video/508864124?h=fcbbcc92fa

    Even worse, if a (valid) trailing slash is added in the embed URL, the video id is removed in the email: <iframe src="https://player.vimeo.com/video/508864124/?h=fcbbcc92fa" ...></iframe> becomes https://vimeo.com/?h=fcbbcc92fa

  2. Is there a way to bypass the iframe-to-URL conversion altogether? Just like we already do with polls, it says something like “Click here to see the poll”

Tricky, we have some special magic to amend how we remap cooked for email processes we can clean up, for sure.

Will put a #pr-welcome for now and consider further prioritization if this pops ups a few more times.

1 Like

Thanks, Sam. Can you think of any temporary workarounds to prevent people from seeing the URL on email without having to hide it in a [details] tag?

Honestly, I can not think of many workarounds here short of maybe forcing a non oneboxed link underneath it?

https://vimeo.com/185876954
<https://vimeo.com/185876954>


https://vimeo.com/185876954

1 Like

@Nacho_Caballero The example you provided of an video that is unlisted, unlisted videos have different url structure.

And the way to embed unlisted video as per Vimeo request is different, ref Use oEmbed with private videos – Help Center

I think a way around may be is to created your own embed using the doc above.

@sam
And for discourse, would it be better may be to use viemo API to get embed src url instaed of building it. ref Vimeo URL I've never seen before with two different IDS. How do I get it to work with one? - Stack Overflow . And those lines releavnt discourse/vimeo_onebox.rb at 657256a099a601a0694d11d15c42ad76988efe8c · discourse/discourse · GitHub

Anyway if my specualtion is right then this should affect typical posting not only email: 1-Minute Audio Test for Stereo Speakers & Headphones-2ZrWHtvSog4

To get the iframe I did:

GET https://vimeo.com/api/oembed.json?url=https://vimeo.com/508864124/fcbbcc92fa
So I got

{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","html":"<iframe src=\"https:\/\/player.vimeo.com\/video\/508864124?h=fcbbcc92fa&amp;app_id=122963\" width=\"426\" height=\"240\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>","width":426,"height":240,"domain_status_code":403,"video_id":508864124,"uri":"\/videos\/508864124:fcbbcc92fa"}

UTF-8 Decoded: for the iframe

<iframe src="https://player.vimeo.com/video/508864124?h=fcbbcc92fa&amp;app_id=122963" width="426" height="240" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>

The iframe itself

Edit/Update:

I have submitted a PR to fix, I think the problem was with regex pattern. It didn’t captured vimeo correcly when its not the standard type. Thus I changed the regex pattern accordingly.

1 Like