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

Embedding Vimeo video does not work with "unlisted" links #5390

Closed
Joda66 opened this issue May 3, 2023 · 16 comments · Fixed by #5542
Closed

Embedding Vimeo video does not work with "unlisted" links #5390

Joda66 opened this issue May 3, 2023 · 16 comments · Fixed by #5542
Assignees
Labels
bug Something isn't working video
Milestone

Comments

@Joda66
Copy link

Joda66 commented May 3, 2023

Description

Unlisted Vimeo videos produce a link that does not work with the Quarto shortcode {{ video }}

Steps to Reproduce

  • Log in with a Standard Account.
  • select a video with privacy settings "unlisted"
  • click the share link button
  • The link copied to the clipboard is https://vimeo.com/800138810/fdcc90d662?share=copy
  • Use this link in the video short code {{< video https://vimeo.com/800138810/fdcc90d662?share=copy >}}

Expected Result:

A video snippet is created with the url. The video snippet can load the video.

Actual Result:

Using this link with the shortcode results in the error message "Invalid embedding-code"

Workaround

Replace the slash in the privacy hash with "?h=" and delete "?share=copy" so
{{< video https://vimeo.com/800138810?h=fdcc90d662 >}}

Please note: the privacy setting "Hide from Vimeo", that creates links for embedding only, does not (!) contain a privacy hash and works well with the shortcode {{< video https://vimeo.com/800139587?share=copy >}} so no problem for "Hide-from-Vimeo" videos as of writing this post, but only for "Unlisted" videos.

@Joda66 Joda66 added the bug Something isn't working label May 3, 2023
@mcanouil mcanouil added the video label May 3, 2023
@cderv
Copy link
Collaborator

cderv commented May 3, 2023

@allenmanning are vimeo videos supposed to be supported by our own Lua filter or by video.js integration ?

I am still unsure about this and this is not the first time I am asking myself this question. I am wondering because currently with both example above, I believe video.js will be used because there is no https:// in the link used. Our video builder will quit early

local VIMEO_STANDARD = 'https://vimeo.com/'
local match = checkEndMatch(params.src, VIMEO_STANDARD)

Videojs builder will then be used, but it is unclear to me what we package for this because vimeo is supposed to be surported with a plugin

Anyhow, you know the feature the best.

@cderv cderv added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label May 3, 2023
@allenmanning allenmanning removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label May 4, 2023
@allenmanning allenmanning added this to the v1.4 milestone May 4, 2023
@allenmanning allenmanning added good-first-issue Good for newcomers, fairly well defined and removed good-first-issue Good for newcomers, fairly well defined labels May 4, 2023
@allenmanning
Copy link
Contributor

@Joda66 Thanks for posting this bug.

I'd like to learn more about how these links have changed. When I ran a local test I see that the share link seems to be the same as before:

image

When I check the docs, I'm seeing the same pattern
https://help.vimeo.com/hc/en-us/articles/12426502519313-How-to-share-your-videos

This other pattern we can consider supporting, I'm curious to learn more about how it is being generated.

@allenmanning allenmanning added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label May 4, 2023
@allenmanning
Copy link
Contributor

@allenmanning are vimeo videos supposed to be supported by our own Lua filter or by video.js integration ?

I am still unsure about this and this is not the first time I am asking myself this question. I am wondering because currently with both example above, I believe video.js will be used because there is no https:// in the link used. Our video builder will quit early

local VIMEO_STANDARD = 'https://vimeo.com/'
local match = checkEndMatch(params.src, VIMEO_STANDARD)

Videojs builder will then be used, but it is unclear to me what we package for this because vimeo is supposed to be surported with a plugin

Anyhow, you know the feature the best.

This is a good point as it seems we could use VideoJS for this. I think that we want to use the vendor snippets like we do for YouTube as this really seems to be more the expected behaviour. We could consider adding support for VideoJS if there seems like there is a real demand for this.

VideoJS is the fall-back if we don't recognize the URL as being mapped to an existing vendor snippet.

@allenmanning allenmanning modified the milestones: v1.4, Future May 4, 2023
@cderv
Copy link
Collaborator

cderv commented May 4, 2023

Note sure if I was clear in my previous post. Sorry if it was, but I prefer to be sure.

Currently using this syntax (which is the share link without https:// part)

{{< video vimeo.com/817906412 >}}

will not be recognized and it will fallback to videojs I believe. (I think it did in my test).

VideoJS is the fall-back if we don't recognize the URL as being mapped to an existing vendor snippet.

I would have expected vimeo.com to be recognized and the vendor snippet to be used and not videojs.

Doing this will correctly not use videojs

{{< video https://vimeo.com/817906412 >}}

Shouldn't we improve that and also match when no https:// explicit ?

@Joda66
Copy link
Author

Joda66 commented May 4, 2023

Thanks, @allenmanning, for your response.

I´m selecting "Hide from Vimeo" and also disable sharing for my videos, as I want only a group of selected students to work on those. This worked fine in the past, I copied the generated link not from the sharing icon you show in your screenshot, but from the sharing button in the dialog where I can customize the settings.

Bildschirmfoto 2023-05-04 um 15 16 19

A few days ago Vimeo changed something here and is informing the user, the "hide from Vimeo" will be depreciated.
However, the created links still work fine.

When I create a new video an prepare it for sharing, the "Hide from Vimeo"-Option has been replaced by the "Unlisted" option an the created links show the new pattern:
https://vimeo.com/823137111/7da580d79b?share=copy

Bildschirmfoto 2023-05-04 um 15 19 28

Thanks for looking into the topic.
In the meantime I´m uploading to youtube which works fine, but I would prefer to present my videos without ads.

@cderv
Copy link
Collaborator

cderv commented May 4, 2023

For reference:

Articles about the change : https://help.vimeo.com/hc/en-us/articles/13808733889425

Possibly related security change ongoing: https://help.vimeo.com/hc/en-us/articles/13741122177169

I see no example of the link in the part about sharing private video

So hard to share about this specific change of the link. What they say though:

If your video has the privacy setting "Hide from Vimeo," viewers will be able to watch your video embedded on another website, but the Vimeo.com video page will only be visible to you (as the video owner)

So I wonder if the link is the correct one to embed.
@Joda66 in your last screenshot - what is the link you see when yu click on "Embed" button ? Is it the same ?

@Joda66
Copy link
Author

Joda66 commented May 4, 2023

Thanks, @cderv for your reply!

The link I get when klicking on the link-icon is
https://vimeo.com/823137111/7da580d79b?share=copy

A workaround (that is also recommended for wordpress in the article you provided) is embedding html. This works fine with the code, that vimeo is providing, but obviously, it is not the solution we are looking for.

@cderv
Copy link
Collaborator

cderv commented May 4, 2023

The link I get when klicking on the link-icon is

So this link seems better, isn't it ? does it work with the video shortcode ?

A workaround (that is also recommended for wordpress in the article you provided) is embedding html.

The video shortcode is supposed to write this specific HTML code for you based on the link you are passing to the shortcode.

@Joda66
Copy link
Author

Joda66 commented May 4, 2023

Thx @cderv for your reply.

It is strange, rendering resulted in the "No video source specified for video shortcode" - error yesterday a this morning, but not it renders without complaints. However, the video is not displayed.

In the screenshot I tried shortcode (results in video not found), html-embedding (this works) and publishing a video via shortcode that is not unlisted. This works also. So I assume, the problem could be the "privacy key" (I have underlined it in blue) which is added to links for unlisted videos?

Bildschirmfoto 2023-05-04 um 18 15 30

@cderv
Copy link
Collaborator

cderv commented May 4, 2023

Possibly related to privacy hash yes.

FWIW the link vimeo.com/823137111/7da580d79b?share=copy gives me page not found on my side. What does it get you when you click on it ?

Possibly related to

If your video has the privacy setting "Hide from Vimeo," viewers will be able to watch your video embedded on another website, but the Vimeo.com video page will only be visible to you (as the video owner)

It is possibly that for unlisted video, one need to use the specific url with ?h=

If this url vimeo.com/823137111/7da580d79b?share=copy is valid from vimeo share button, I don't know if we can make a rule to extract the part after / and consider it the hash to put after ?= when building the embed html part.

Our vimeo builder is here

local vimeoBuilder = function(params)
if not (params and params.src) then return nil end
local VIMEO_STANDARD = 'https://vimeo.com/'
local match = checkEndMatch(params.src, VIMEO_STANDARD)
if not match then return nil end
params.src = 'https://player.vimeo.com/video/' .. match
local SNIPPET = [[<iframe data-external="1" src="{src}"{width}{height} frameborder="0" allow="autoplay; title="{title}" fullscreen; picture-in-picture" allowfullscreen></iframe>]]
local result = {}
result.snippet = replaceCommonAttributes(SNIPPET, params)
result.type = VIDEO_TYPES.VIMEO
result.src = params.src
result.videoId = match
return result
end

and we build the iframe by inserting the video link to src. If you use video shortcode with the same url as you have in embed test then it should work.

So it seems some special treatment needs to be done for unlisted video - but can we know for sure this is unlisted ? Is this https://vimeo.com/<video_id>/<privacy_hash> really a pattern ? I can't find the spec.

@allenmanning proposal: I think we should try to handle this https://vimeo.com/<video_id>/<privacy_hash> in our shortcode

Found this article to comfort the choice https://www.denisbouquet.com/vimeo-url-2-strings-unlisted-hash-videos-with-2-ids/

@Joda66
Copy link
Author

Joda66 commented May 4, 2023

The link which does not work for you is fine at my account, because I'm logged in to Vimeo.
It is according to the description of Vimeo, that it does not work at your computer, because it should be valid for embedding only, according to the description of Vimeo, but not for sharing.
Following your hint and replacing the privacy hash
/7da580d79b
with the code used in the embedding from Vimeo
?h=7da580d79b
finally worked!

Thanks a lot for this idea.
Would be great, if the shortcode could cope with this matter in the future.
Thx, Markus

@allenmanning allenmanning modified the milestones: Future, v1.4 May 5, 2023
@allenmanning allenmanning removed the needs-repro Issues that are blocked until reporter provides an adequate reproduction label May 5, 2023
@allenmanning
Copy link
Contributor

Thanks @cderv and @Joda66 for the research and additional information.

@Joda66
Copy link
Author

Joda66 commented May 5, 2023

Just realized, that Vimeo has rolled back its update to the privacy settings:
https://help.vimeo.com/hc/en-us/articles/13808733889425-What-happened-to-the-Hide-from-Vimeo-privacy-setting-

The hide-from-vimeo-option generates links without privacy hashes.

However, the Unlisted-Option still requires dealing with the privacy hash.
For the links that are generated as of today, this means replacing the "/" before the privacy-hash with "?".

@allenmanning
Copy link
Contributor

Apologies, I have read through the thread again and I'm not clear as to the current proposed change.

Can you please provide clear Steps to Reproduce following a template like this:

Bug Template

Description:

Embedding Vimeo video does not work with "new" links.

Steps to Reproduce:

  • When logged into vimeo with an upgraded vimeo account
  • Select a video and ...
  • Click the share link and ...
  • In quarto use this vimeo video shortcode {{< video >}}

Expected Result:

Video snippet is created with the URL ...

Actual Result:

Video snippet isn't created and it falls-back to Video JS.

@allenmanning allenmanning added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label May 9, 2023
@Joda66
Copy link
Author

Joda66 commented May 9, 2023

With the following steps, Vimeo produces a link, that does not work with the Quarto shortcode {{ video }}:

When logged in with my Standard Account.
select a video with privacy settings "unlisted"
click the share link button

The link copied to the clipboard is in my example
https://vimeo.com/800138810/fdcc90d662?share=copy

Expected Result:
A video snippet is created with an url, that displays the video,

Actual Result:
Using this link with the shortcode results in the error message "Invalid embedding-code"
{{< video https://vimeo.com/800138810/fdcc90d662?share=copy >}}

Solution / Workaround
Replace the slash in the privacy has with "?h=" and delete "?share=copy", like this
{{< video https://vimeo.com/800138810?h=fdcc90d662 >}}

Please note: the privacy setting "Hide from Vimeo", that creates links for embedding only, does not (!) contain a privacy hash and works well with the shortcode:
{{< video https://vimeo.com/800139587?share=copy >}}
so no problem for "Hide-from-Vimeo" videos as of writing this post, but only for "Unlisted" videos.

@allenmanning allenmanning removed the needs-repro Issues that are blocked until reporter provides an adequate reproduction label May 11, 2023
@allenmanning
Copy link
Contributor

This makes good sense, thank you. I think it is ready for dev now.

@allenmanning allenmanning changed the title Embedding Vimeo video does not work with "new" links Embedding Vimeo video does not work with "unlisted" links May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working video
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants