PHP code example of githen / laravel-tencent-vod

1. Go to this page and download the library: Download githen/laravel-tencent-vod 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/ */

    

githen / laravel-tencent-vod example snippets


return [
    /**
     *  'secret_id' =>  // API密钥SecretId
     * 'secret_key' =>  // API密钥SecretKey
     * |--------------------------------------------------------------------------
     * | 视频上传配置
     * |--------------------------------------------------------------------------
     * |  '标识' => [
     *      'sub_appid' => , //点播应用的SubAppId
     *      'class_id' => , //点播应用的分类ID
     *       'procedure_name' =>  // 任务流名称
     * ]
     */
return [
    'secret_id' => '***',
    'secret_key' => '***',
    'vod' => [
        'global' => [
            'signature_url' => true, // 注册路由,生成签名  请求地址:/jiaoyu/tencent/vod/sign/{标识}
            'auth' => ['auth'], // 路由中间件
            'size' => 50, // MB
            'ext' => [".mp4"],
        ],
        'sub_appid' => env('TENCENT_VOD_SUB_APPID', 0),
        'class_id' => env('CLASS_ID', 0),
        'procedure_name' => ''
    ],
];

];


// 注入服务的单例 app('jiaoyu.tencent.vod')
// ModifyMediaInfo 支持方法
app('jiaoyu.tencent.vod')->ModifyMediaInfo($label, $request->all());
shell
composer ��文件
php artisan vendor:publish --provider="Githen\LaravelTencentVod\VodProvider"
javascript
myVideo = new Vodupload({
        dom:"#upload_file_input",
        // signature:"vod",
        config:'vod',
        signature:function (){return "{{$sign}}"},
        maxFilesize:{!! config('vod.global.size') !!},
        acceptedFiles:"{!! implode(',', config('vod.global.ext')) !!}",
        replace:false, // 当限制为1个时,是否直接替换
        progressInterval:100,
        cacheTime:600,
        callback:function (type, name, info) {
            // info  每种事件传递的数据信息
            
            // 回调会有五个事件
            // type:media name:upload    视频上传完成
            // type:media name:progress  视频上传进度
            // type:cover name:upload    封面图上传完成
            // type:cover name:progress  封面图上传进度
            // type:done name:done       获取视频在腾讯端的基本信息
    
        }
    });