vimeo

How to get a Vimeo external link


To embed a Vimeo video as a background video, I see in this code pen:

https://codepen.io/BRacicot/pen/JpLmqo

that video source url is an special type with "external" word:

https://player.vimeo.com/external/243924757.hd.mp4?s=1fc7fe8bd116cdd9c9c3e639ddbae75f2f4f8f2e&profile_id=174

How can I get this url type from my own videos?


Solution

  • That "external" link is returned in the video response, along with download links.

    To get the direct file links for videos on your account, make an authenticated request to GET https://api.vimeo.com/videos/[video_id]. Two keys are returned in the response: files and download. The files key contains links and related metadata to all the files for the requested video. These links are meant for use with external/third-party media players and do not expire. The download key contains links to the files as well as the expiration time and related metadata for those links.

    Both the files and download links are HTTP 302 redirects to the actual video file resources. The location of the actual video file resources expires every few hours, so make sure you always use the redirect links exactly as provided.

    Be sure that your requests are authenticated with a token that has the video_files scope. If you authenticate with a token that does not have video_files scope, the video response will not contain files or download metadata. Vimeo API authentication docs are found here:

    https://developer.vimeo.com/api/authentication#understanding-auth-workflows

    Also be aware that these video file links are only returned for Vimeo Pro, Premium, and Business members:

    https://help.vimeo.com/hc/en-us/articles/224823567-Third-party-player-links

    Finally, note that you may not need all of this, as the embedded Vimeo Player can be used as a chromeless background video player:

    https://help.vimeo.com/hc/en-us/articles/115011183028-Embedding-background-and-chromeless-videos