lizhen_gitee 4 месяцев назад
Родитель
Сommit
e69c6fe893

+ 2 - 2
application/admin/controller/Voteplayer.php

@@ -56,7 +56,7 @@ class Voteplayer extends Backend
         if(!empty($params['video_file'])){
             $full_filepath = config('upload.cdnurl').$params['video_file'];
             $uploadvideo = new Uploadvideo();
-            $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['name']);
+            $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['title']);
             $params['vodid'] = $res;
         }
         //从oss上传到vod
@@ -117,7 +117,7 @@ class Voteplayer extends Backend
         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']);
+            $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['title']);
             $params['vodid'] = $res;
         }
         //从oss上传到vod

+ 1 - 1
application/admin/view/voteplayer/add.html

@@ -9,7 +9,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text" value="">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
         </div>
     </div>
     <div class="form-group">

+ 1 - 1
application/admin/view/voteplayer/edit.html

@@ -9,7 +9,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
         </div>
     </div>
     <div class="form-group">

+ 10 - 1
application/api/controller/Demo.php

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use app\common\controller\Api;
 use think\Db;
+use app\common\library\Uploadvideo;
 /**
  * 示例接口
  */
@@ -40,7 +41,15 @@ class Demo extends Api
      */
     public function test()
     {
-        $this->success('返回成功', $this->request->param());
+        $params = [
+            'video_file' => '/uploads/20241101/b472251c04af8842b14f6c15a57fca9b.mp4',
+            'title' => '测试',
+        ];
+        $full_filepath = config('upload.cdnurl').$params['video_file'];
+
+        $uploadvideo = new Uploadvideo();
+        $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['title']);
+        $params['vodid'] = $res;
     }
 
     /**

+ 2 - 2
application/common/library/Uploadvideo.php

@@ -8,8 +8,8 @@ class Uploadvideo{
     public function __construct(){
         date_default_timezone_set('PRC');
 
-        $this->accessKeyId = 'LTAI5tCmhmtpkP45oPnM73fb';
-        $this->accessKeySecret = 'ba4MhM2Qs4lbiCacKtR54ATVInfxVo';
+        $this->accessKeyId = 'LTAI5tQtgaZ2fDb7Ascp96Wj';
+        $this->accessKeySecret = 'qAvIB98inVltwiCHf8LPi38BWyQ1bV';
     }
 
     public function test1(){

+ 3 - 3
extend/voduploadsdk/uploader/AliyunVodUploader.php

@@ -17,7 +17,7 @@ class AliyunVodUploader
         $this->accessKeySecret = $accessKeySecret;
         if (empty($apiRegionId)) {
             // VoD的接入地址,国内为cn-shanghai,参考:https://help.aliyun.com/document_detail/98194.html
-            $this->apiRegionId = 'cn-shanghai';
+            $this->apiRegionId = 'cn-beijing';
         }
         else {
             $this->apiRegionId = $apiRegionId;
@@ -551,8 +551,8 @@ class AliyunVodUploader
         else {
             $rate = 0;
         }
-        printf("[%s]UploadProgress of Media %s, uploaded %s bytes, percent %s%s\n",
-            AliyunVodUtils::getCurrentTimeStr(), $mediaId, $consumedBytes, round($rate, 1), '%');
+        /*printf("[%s]UploadProgress of Media %s, uploaded %s bytes, percent %s%s\n",
+            AliyunVodUtils::getCurrentTimeStr(), $mediaId, $consumedBytes, round($rate, 1), '%');*/
         flush();
     }
 

+ 1 - 1
extend/voduploadsdk/uploader/AliyunVodUtils.php

@@ -121,7 +121,7 @@ class AliyunVodUtils
 
 class AliyunVodLog
 {
-    public static $logSwitch = true;
+    public static $logSwitch = false;
     public static function printLog($format, $args = null, $_ = null) {
         if (!AliyunVodLog::$logSwitch) {
             return;