PHP code example of black-bits / preview-thumbnails

1. Go to this page and download the library: Download black-bits/preview-thumbnails 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/ */

    

black-bits / preview-thumbnails example snippets


// initialize test data
$files = [
        '1.jpg',
        '2.jpg',
        '3.jpg',
];

$timespan = 5; // in seconds

// option 1
$previewThumbnails = new \BlackBits\PreviewThumbnails\PreviewThumbnails($timespan);
return $previewThumbnails->getVTT($files);

// option 2
$previewThumbnails = new \BlackBits\PreviewThumbnails\PreviewThumbnails();
$previewThumbnails->setTimespan($timespan);
return $previewThumbnails->getVTT($files);

// option 3
$previewThumbnails = new \BlackBits\PreviewThumbnails\PreviewThumbnails();
return $previewThumbnails->setTimespan($timespan)->getVTT($files);

// option 4
return PreviewThumbnails::getVTT($files);

// option 5
return PreviewThumbnails::setTimespan($timespan)->getVTT($files);