jasonadriaan / videocloudcms
A simple way to interact with Brightcove's VideoCloud CMS API
Fund package maintenance!
jasonadriaan
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.4
- illuminate/contracts: >8.73
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-09-29 17:10:06 UTC
README
This package makes it simple for you to retrieve and update videos on Brightcove VideoCloud's CMS API without having to deal with authentication or repetitive api calls.
Support: Buy me a coffee
I build and maintain this project in my free time. If it makes your life simpler you can buy me a coffee.
Installation
You can install the package via composer:
composer require jasonadriaan/videocloudcms
You can publish the config file with:
php artisan vendor:publish --tag="videocloudcms-config"
In your .env file please add the following lines with your API details from Brightcove VideoCloud
VIDEOCLOUD_ACCOUNT_ID=xxxxx VIDEOCLOUD_API_KEY=xxxxx VIDEOCLOUD_API_SECRET=xxxxx
Usage
I would recommend you go ahead and read the VideoCloud CMS API documentation to understand the underlying API.
Updating a Video:
use Jasonadriaan\VideoCloudCMS\VideoCloudCMS; class main extends Controller { public function index(){ $payload = array( 'name' => 'Scooby Doo!', ); $videocloud = new VideoCloudCMS(); /* Update requires a video id and a payload * eg. update($video_id, $payload) */ $result = $videocloud->update(1234567890, $payload); return $result; } }
Get a list of videos:
use Jasonadriaan\VideoCloudCMS\VideoCloudCMS; class main extends Controller { public function index(){ $videocloud = new VideoCloudCMS(); $result = $videocloud->limit(5) ->offset(2) ->query() ->sort() ->getVideos(); return $result; } }
Get a specific video:
use Jasonadriaan\VideoCloudCMS\VideoCloudCMS; class main extends Controller { public function index(){ $videocloud = new VideoCloudCMS(); /* getVideo requires a video id * eg. getVideo($video_id) */ $result = $videocloud->getVideo(1234567); return $result; } }
Get a count of how many videos are on the system:
use Jasonadriaan\VideoCloudCMS\VideoCloudCMS; class main extends Controller { public function index(){ $videocloud = new VideoCloudCMS(); $result = $videocloud->getCount(); return $result; } }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.