steadfastcollective / laravel-api-video
Laravel package for API.Video
v1.0.0
2021-06-22 10:21 UTC
Requires
- php: ^7.4|^8.0
- api-video/php-sdk: ^1.8
- illuminate/support: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
Introduction
This package is a Laravel wrapper around the api.video API that lets you upload & manage your videos directly from your Laravel app. This package is unofficial and is maintained by Steadfast Collective.
Documentation
Installation
- Install with Composer
composer require steadfastcollective/laravel-api-video
- Publish the configuration file
php artisan vendor:publish --tag="api-video-config"
- Add your API key and the API URI to your
.env
API_VIDEO_URL=https://sandbox.api.video
API_VIDEO_KEY=....
Usage
The primary way to use this package is via the Facade. If you'd prefer to not use the class, you may use the ApiVideo
class directly, like the below example.
use SteadfastCollective\ApiVideo\ApiVideo; return (new ApiVideo)->getVideo(...);
Get delegate token
TODO: docs link
use SteadfastCollective\ApiVideo\Facades\ApiVideo; return ApiVideo::getDelegateToken();
Get video
use SteadfastCollective\ApiVideo\Facades\ApiVideo; return ApiVideo::getVideo($videoId);
Parameters
videoId
: The unique identifier for the video you want details about.
Update video
use SteadfastCollective\ApiVideo\Facades\ApiVideo; return ApiVideo::updateVideo($videoId, [$params]);
Parameters
videoId
: The video ID for the video you want to update.params
: Array of parameters you wish to send to api.video. List of available parameters.
Delete video
use SteadfastCollective\ApiVideo\Facades\ApiVideo; return ApiVideo::deleteVideo($videoId);
Parameters
videoId
: The video ID for the video you want to delete.
Other endpoints?
Currently this SDK only provides a few of the available API methods provided by api.video's API. However, if you're in need of any others, please create an issue and we'll see to adding it!
License
Laravel api.video is open-sourced software licensed under the MIT license.