Get Vimeo thumbnails for private videos
Asked Answered
G

3

5

I have a list of Vimeo private video urls (https://player.vimeo.com/video/1234567890), which I'd like to display as thumbnails on my page. I can't find a working way to do it.

Any solutions based on http://vimeo.com/api/v2/video/{id} are long dead.

And something like this https://i.vimeocdn.com/video/1234567890.jpg would return the wrong image.

Is there a way to get an image thumbnail url based on video id without authorization ?

UPDATE

In my case, I manged to get the thumbnail_url by querying

GET https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/{id}

Greenhorn answered 2/10, 2018 at 9:33 Comment(0)
H
8

oEmbed can be used to get a video's thumbnail links, depending on the video's privacy settings.

First off, oEmbed will only return metadata when the video has embed privacy set to "Embed Anywhere" or "Only on site I choose". A video with its embed privacy to "Embed Nowhere" will return 403.

Videos with these viewing privacy settings will return "full" metadata (including thumbnail links):

  • Anyone
  • Only people with the private link (must use the complete video url)
  • Hide this video from vimeo.com

Videos with these viewing privacy settings will only return the embed code:

  • Only people I follow
  • Only people I choose
  • Only people with a password

oEmbed documentation can be found here: https://developer.vimeo.com/apis/oembed

Honorarium answered 2/10, 2018 at 15:1 Comment(1)
Thanks for your help. Since I don't have access to the account, I was unable to check our privacy settings and what exactly those setting hide. You explanation cleared things up for me.Greenhorn
E
0

I just found the solution for getting the Meta Data from Vimeo, with private videos. You can see the solution here:

VIMEO not consistently returning video title, duration or thumbnail url : REMOTE HEADER?

Ecthyma answered 31/1, 2022 at 4:43 Comment(0)
H
0

Using the Official PHP Library, this code worked for me..

require "path_to_library"
use Vimeo\Vimeo;
$video_id = "";
$vimeo_client_id = "";
$vimeo_client_secret = "";
$vimeo_access_token = "";
$client = new Vimeo($vimeo_client_id, $vimeo_client_secret, $vimeo_access_token);
$response = $client->request("/videos/$video_id/pictures/");
echo $response['body']['data'][0]['sizes'][count($response['body']['data'][0]['sizes'])-1]['link_with_play_button'];

This returns the largest thumbnail size, with the play button.

Hyperform answered 4/12, 2023 at 17:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.