ソースを参照

视频oss传入到vod

lizhen_gitee 5 ヶ月 前
コミット
4dbc5e00a6
1 ファイル変更19 行追加0 行削除
  1. 19 0
      application/admin/controller/Voteplayer.php

+ 19 - 0
application/admin/controller/Voteplayer.php

@@ -51,6 +51,15 @@ class Voteplayer extends Backend
         }
         $params = $this->preExcludeFields($params);
 
+        //从oss上传到vod
+        if(!empty($params['video_file'])){
+            $full_filepath = config('upload.cdnurl').$params['video_file'];
+            $uploadvideo = new Uploadvideo();
+            $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['name']);
+            $params['vodid'] = $res;
+        }
+        //从oss上传到vod
+
         if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
             $params[$this->dataLimitField] = $this->auth->id;
         }
@@ -102,6 +111,16 @@ class Voteplayer extends Backend
             $this->error(__('Parameter %s can not be empty', ''));
         }
         $params = $this->preExcludeFields($params);
+
+        //从oss上传到vod
+        if($row['video_file'] != $params['video_file'] && !empty($params['video_file']) ){
+            $full_filepath = config('upload.cdnurl').$params['video_file'];
+            $uploadvideo = new Uploadvideo();
+            $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['name']);
+            $params['vodid'] = $res;
+        }
+        //从oss上传到vod
+
         $result = false;
         Db::startTrans();
         try {