PHP code example of mehrdad-dadkhah / hls-video-generater

1. Go to this page and download the library: Download mehrdad-dadkhah/hls-video-generater 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/ */

    

mehrdad-dadkhah / hls-video-generater example snippets


use MehrdadDadkhah\Video\HlsGenerater;

$hlsGenerater = new HlsGenerater();
$result = $hlsGenerater->setSource('path-to-video')
            ->setOutputDirectory('path-to-output-directory')
            ->checkAndGenerateOutputDirectory()
            ->setUri('/example/uri')
            ->setPrefix('sprite')
            ->setFilesOwnerAndPermission('root:www-data', 775)
            ->generate();