PHP code example of sseffa / video-api

1. Go to this page and download the library: Download sseffa/video-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sseffa / video-api example snippets


    'providers' => array(
        // ...
        'Sseffa\VideoApi\VideoApiServiceProvider',
    ),

    'aliases' => array(
        // ...
        'VideoApi'          => 'Sseffa\VideoApi\Facades\VideoApi',
    ),



Route::get('video/youtube/{id}', function ($id) {

    //$data = VideoApi::setType('youtube')->setKey('api-key')->getVideoDetail($id); // video detail
    $data = VideoApi::setType('youtube')->setKey('api-key')->getVideoList($id);     // video list

    var_dump($data);
});

Route::get('video/vimeo/{id}', function ($id) {

    //$data = VideoApi::setType('vimeo')->getVideoDetail($id);
    $data = VideoApi::setType('vimeo')->getVideoList($id);

    var_dump($data);
});