How to use vimeo advanced API to display video

I used the simple Vimeo API to display video from a channel on my website, but as you know, it has a limit. I was wondering if you can give an example of using the advanced API. I read the documentation, but I just don't know how to use these methods (obviously, I'm not a php expert).

So, it would be great if you could show me one example or any tutorial, if I could understand it.

This is part of the code I used in a simple API:

var apiEndpoint = 'http://vimeo.com/api/v2/'; var oEmbedEndpoint = 'http://vimeo.com/api/oembed.json' var oEmbedCallback = 'switchVideo'; var videosCallback = 'setupGallery&iframe=false'; $(document).ready(function() { $.getScript(apiEndpoint + vimeoUsername + '/videos.json?callback=' + videosCallback); }); function setupGallery(videos) { for (var i = 0; i < videos.length; i++) { var html = '<li><a href="' + videos[i].url +'"alt="'+videos[i].title+'"><img src="' + videos[i].thumbnail_large + '" class="thumb" />'; html += '<div><p>' + videos[i].title + '</p></div></a></li>'; $('#thumbs ul').append(html); } 

I just want to do the same thing, but with an API (using php).

Thanks so much, I would appreciate any advice.

+7
source share
1 answer

[edit] NOTE: This is an old, extended API. It is no longer supported by Vimeo or is available to new application developers. Please refer to the new documentation for download at https://developer.vimeo.com/api/upload/videos

  • Build APP APPs on developer.vimeo.com/apps
  • Use the official PHP library

After that you need to create a vimeo object

 // You must replace CONSUMER_KEY and CONSUMER_SECRET with the values from your app $vimeo = new phpVimeo('CONSUMER_KEY', 'CONSUMER_SECRET'); 

Once you have a vimeo object, you can make api calls using the call method. This method uses the api method.

 $videos = $vimeo->call('VIMEO_METHOD'); 

In your specific use case, by finding the videos uploaded by the user, you use the vimeo.videos.getUploaded method. You can find additional documentation (and try it!) On the vimeo api playground

Once you understand all this, I believe that the following code will work for you.

 $vimeo = new phpVimeo('CONSUMER_KEY', 'CONSUMER_SECRET'); $videos = $vimeo->call('vimeo.videos.getUploaded', array('user_id' => $vimeo_username)); 
+5
source

All Articles