Browse Source

增加视频转码功能

15954078560 3 years ago
parent
commit
8662c9767d
2 changed files with 10 additions and 6 deletions
  1. 5 5
      application/api/controller/Eyemargin.php
  2. 5 1
      application/config.php

+ 5 - 5
application/api/controller/Eyemargin.php

@@ -275,11 +275,11 @@ class Eyemargin extends Common
     {
         $access_key_id = config('oss.secretId'); //AccessKey ID
         $access_key_secret = config('oss.secretKey'); //AccessKey Secret
-        $mps_region_id = 'cn-hangzhou';
-        $pipeline_id = '0c4f9b648be54da09e29d8819f60a0df'; //管道id
-        $watermark_template_id = '0c09ed4ef64e424b89a3449bcc0de522'; //水印模板id
-        $template_id = '4c43c0ff9436425dbb6eaf2ce74e0ff0';//'S00000001-200030'; //转码模板id
-        $oss_location = 'oss-cn-hangzhou';
+        $mps_region_id = config('oss.mps_region_id');
+        $pipeline_id = config('oss.pipeline_id'); //管道id
+        $watermark_template_id = config('oss.watermark_template_id'); //水印模板id
+        $template_id = config('oss.template_id');//'S00000001-200030'; //转码模板id
+        $oss_location = config('oss.region');
         $oss_bucket = config('oss.bucket'); //bucket
 //        $oss_input_object = 'uploads/xuanzhuan.mp4'; //输入文件
 //        $oss_output_object = 'output/xuanzhuan.mp4'; //输出文件

+ 5 - 1
application/config.php

@@ -321,7 +321,11 @@ return [
         'durationSeconds'      => 1800,
         // 允许的路径前缀,可以根据自己网站的用户登录态判断允许上传的具体路径,例子: a.jpg 或者 a/* 或者 * (使用通配符*存在重大安全风险, 请谨慎评估使用)
         'allowPrefix'      => '*',
-
+        // 视频转码配置
+        'mps_region_id'    => 'cn-hangzhou', //地区
+        'pipeline_id'    => '0c4f9b648be54da09e29d8819f60a0df', //管道id
+        'watermark_template_id'    => '0c09ed4ef64e424b89a3449bcc0de522', //水印模板id
+        'template_id'    => '4c43c0ff9436425dbb6eaf2ce74e0ff0', //转码模板id
     ],
     'imgurl' => ["image","cover","avatar","album","old_avatar","music"],
     'onLogin' => [