sseffa/video-api

There is no license information available for the latest version (2.3.0) of this package.

Laravel Video Data (youtube/vimeo) API

2.3.0 2017-03-20 19:32 UTC

This package is auto-updated.

Last update: 2024-10-29 03:28:01 UTC


README

Latest Stable Version Total Downloads Build Status

Installation

1. Install with Composer

composer require "sseffa/video-api": "dev-master"

2. Add to app/config/app.php

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

And:

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

Usage

Youtube API Key

<?php

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);
});

Licence

MIT license