jasonadriaan / videocloudanalytics
A simple way to use Brightcove's VideoCloud Analytics 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-11-29 10:59:38 UTC
README
This package makes it simple for you to retrieve analytics from Brightcove VideoCloud's Analytics 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/videocloudanalytics
You will need to publish the config file with:
php artisan vendor:publish --tag="videocloudanalytics-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 Analytics API documentation to understand the underlying API.
Basic usage within your app would be as follows:
use Jasonadriaan\VideoCloudAnalytics\VideoCloudAnalytics; class main extends Controller { public function index(){ $videocloud = new VideoCloudAnalytics(); $items = $videocloud->dimensions('date') ->from('2021-08-04') ->to('2022-01-31') ->fields('date,daily_unique_viewers,video_view') ->sort('date') ->limit(30) ->get(); return $items; } }
Notes:
- The get() method will return a Laravel Collection to make it easier for you to work with the data returned.
- The only required field would be the dimensions field. If you do not provide it the API call will fail.
- For the full Dimension Guide please go read the official documentation.
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.