Laravel Video API
Installation
1. Install with Composer
composer require "Vovanmix/video-api": "dev-master"
2. Add to app/config/app.php
'providers' => array(
// ...
'Vovanmix\VideoApi\VideoApiServiceProvider',
),
And:
'aliases' => array(
// ...
'VideoApi' => 'Vovanmix\VideoApi\Facades\VideoApi',
),
Usage
<?php
Route::get('video/youtube/{id}', function ($id) {
//$data = VideoApi::setType('youtube')->getVideoDetail($id); // video detail
$data = VideoApi::setType('youtube')->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);
});
Licence
MIT license