Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get URL/Embed code to private Vimeo videos programatically

We've been long time users of Vimeo PRO, we use it to host our videos that are shown in multiple websites. Those videos are set to private, so they can't be found in the public part of Vimeo. Until now, whenever we needed to show a video, we would either get the embed code from Vimeo or copy the "direct link" (i.e. http://player.vimeo.com/external/1234567890.hd.mp4?s=nskljdfnsdlkn3498hnc3h49fo83h4oif3) to the video file of the desired quality and load it on a third party player. No issues at all doing all this.

Now we're going to start handling a lot more videos, so I've been looking at a way of automatizing the process of obtaining those embed codes or direct links. Looks like the way to go is by using the Vimeo API.

However, I've started looking into it and I'm pretty confused. It talks about registering apps, give users permissions when they request access, and other things that seem an overkill for what I really need.

We have no apps to register or multiple users to grant access, we just have our Vimeo username/password and the idea is to code a function that can be used in different websites to request a video URL or its embed code based on its Vimeo ID.

Am I looking in the wrong place? If not, what "app" should I register? Every single website that's going to use a video from Vimeo? (we have dozens)

If the Vimeo API is the only way to go, could someone link to an example as simple as possible for the kind of usage we need?

Thanks!

like image 612
Albert Avatar asked Dec 19 '14 00:12

Albert


People also ask

How do I get an embedded URL from Vimeo?

Go to Vimeo and find the video you want to embed. Once you are on the page, locate the share button on or below the video. After selecting Share a new window will open. The copied Embed Code can then be pasted in the Embed URL field for the Gallery Video content type.

How does Vimeo private link work?

Private means that only you (and members of your team) can see your video. Password will allow you to add a password for viewers to gain access to your video, including Vimeo and non-Vimeo members.

Does Vimeo have an embed code?

Go to Vimeo, and find the video you want to embed. There, click the "Share" button on the right side of the video — it looks like a paper airplane. 2. At the bottom of the pop-up that opens, you'll see an "Embed" header, underneath which is the embed code.


1 Answers

The Vimeo API is the right system to use, and I'll describe briefly what will work best for your described workflow.

  1. Register an API app on https://developer.vimeo.com/apps

This is necessary for every API app. We need to know who is using our system, and how to contact them if necessary.

  1. Generate an access token.

There is general documentation at https://developer.vimeo.com/api/authentication, but you will likely be using the "single user application" workflow. It's a lofty title for "generate an access token via the UI on your application page, then hard code it into your app". This access token will interact with the API on behalf of the user who registered the application.

  1. Request your video information.

There are many different API calls to get video information. You can find these at https://developer.vimeo.com/api/endpoints. /me/videos will show all of the authenticated users videos, /videos/{video_id} will show a single video.

like image 170
Dashron Avatar answered Oct 26 '22 07:10

Dashron