PHP code example of wlfpanda1012 / video-transformer

1. Go to this page and download the library: Download wlfpanda1012/video-transformer 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/ */

    

wlfpanda1012 / video-transformer example snippets


#aliyun
ALIYUN_OSS_ACCESS_ID=**************
ALIYUN_OSS_ACCESS_SECRET=**************
ALIYUN_OSS_BUCKET=bucket_name

$aliyun  = Config::get('transformer.aliyun');
$transformer = new Transformer($aliyun['accessId'],$aliyun['accessSecret'],$aliyun['endpoint'],$aliyun['bucketName'],$aliyun['region']);
var_dump($transformer->previewM3U8('video/2024-11/67298e3bbf920.mp4',VideoStyle::H264_M3U8_720P));
bash
php bin/hyperf.php vendor:publish wlfpanda1012/video-video-transformer

+ ./config/autoload/translation.php

php artisan vendor:publish --tag=transformer-config

+ ./config/translation.php