PHP code example of vectorly / php-client

1. Go to this page and download the library: Download vectorly/php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vectorly / php-client example snippets



$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;

/**
 * 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' );

$analytics = $client->analytics();
print_r($analytics);

$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);
bash
composer