A php wrapper for Vectorly rest api, that offers a number of methods to interact with Vectorly's Rest service.
ankitpokhrel/tus-php
as a Tus Clientguzzlehttp/guzzle
for http calls
composer require vectorly/php-client
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
$client = new Vectorly\Client( 'API_KEY_GOES_HERE' );
$videos_list = $client->list();
print_r( $videos_list );
$bytes_uploaded = $client->upload( '/path/to/file' );
echo $bytes_uploaded;
or
/**
* Upload the file
* With a custom name (optional),
* Set the unique id (optional),
* And upload a chunk of 1MB (optional)
*/
$bytes_uploaded = $client->upload( '/path/to/file', 'my_custom_name.mp4', 'my_unique_id', 1000000 );
echo $bytes_uploaded;
$video_details = $client->details( 'video_id' );
print_r( $video_details );
$videos_list = $client->search( 'search_term' );
print_r( $videos_list );
$client->download( 'video_id', '/path/to/output/file.mp4' );
Overall summary of video playback over the last 30 days
$analytics = $client->analytics();
print_r($analytics);
Retrieve all events from the last 90 days for a particular video
$events = $client->events('video_id');
print_r($events);
$account_details = $client->account();
print_r($account_details);
/**
* Get a temporary url that grants access to the video for ten minutes
* If the duration is omitted, the default value is one minute
*/
$temporary_url = $client->secure('video_id', 10);
print_r($temporary_url);