PHP code example of serch3 / bunny-stream

1. Go to this page and download the library: Download serch3/bunny-stream 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/ */

    

serch3 / bunny-stream example snippets


use Bunny\Stream\Client;

$client = new Client('YOUR_API_KEY', 'YOUR_LIBRARY_ID');

$videos = $client->video()->list();
foreach ($videos['items'] as $video) {
    echo $video['title'] . "\n";
}

// 1. Create a video entry
$video = $client->video()->create('My Awesome Video');

// 2. Upload using Tus
$uploader = $client->tus()->createUpload(
    $video['guid'],
    '/path/to/video.mp4'
);
$uploader->upload();

$client->collection()->create('New Collection');