how to use vimeo advanced API to display videos

前端 未结 1 1481
灰色年华
灰色年华 2021-02-04 15:58

I was using the Vimeo simple API to display the videos from a channel on my website, but as you may know, it has a limit. I was wondering if you could give me an example of how

相关标签:
1条回答
  • 2021-02-04 16:36

    [edit] NOTE: This is the old, advanced API. It is no longer supported by Vimeo, or accessible by new app developers. Please refer to the new upload documentation at https://developer.vimeo.com/api/upload/videos

    1. Create an Api APP at developer.vimeo.com/apps
    2. Use the official PHP library

    Once you have that, you need to create your 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 the vimeo object, you can make api calls using the call method. This method takes an api method.

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

    For your specific use case, finding the videos uploaded by a user, you use the method vimeo.videos.getUploaded. You can find more documentation (and try it out!) at the vimeo api playground

    Once you understand all of that, I believe the following code would work for you.

    $vimeo = new phpVimeo('CONSUMER_KEY', 'CONSUMER_SECRET');
    $videos = $vimeo->call('vimeo.videos.getUploaded', array('user_id' => $vimeo_username));
    
    0 讨论(0)
提交回复
热议问题