wupengfei 2 years ago
parent
commit
ec16dbc788
2 changed files with 25 additions and 1 deletions
  1. 1 1
      .idea/workspace.xml
  2. 24 0
      application/api/controller/VideoDemand.php

+ 1 - 1
.idea/workspace.xml

@@ -176,7 +176,7 @@
       <workItem from="1660611515701" duration="6983000" />
       <workItem from="1660697982291" duration="9650000" />
       <workItem from="1660730926670" duration="1018000" />
-      <workItem from="1660783282150" duration="5814000" />
+      <workItem from="1660783282150" duration="5908000" />
     </task>
     <servers />
   </component>

+ 24 - 0
application/api/controller/VideoDemand.php

@@ -169,6 +169,30 @@ class VideoDemand extends Base
         $this->success('ok',$res_arr['body'] );
     }
 
+    /**
+     * @title 获取视频播放地址[通过视频ID获取]
+     * @desc 获取视频播放地址[通过视频ID获取]
+     * @author qc
+     * @url /api/Video_demand/getVideoPath
+     * @method GET
+     * @tag 视频播放凭证
+     * @header name:Authorization require:1 desc:Token
+     * @param name:ali_vid type:int require:1  default:0 desc:ali_vid
+     * @return name:playAuth type:string default:-- desc:playAuth
+     * @return name:requestId type:string default:-- desc:requestId
+     */
+    public function getVideoPath()
+    {
+        $client = self::createClient($this->access_key, $this->access_secret);
+        $getVideoPlayAuthRequest = new GetVideoPlayAuthRequest(['videoId'=>input('ali_vid')]);
+        $runtime = new RuntimeOptions([]);
+        $res = $client->getVideoPlayAuthWithOptions($getVideoPlayAuthRequest, $runtime);
+        $json_res =  json_encode($res,true);
+        $res_arr = json_decode($json_res,true);
+        $this->success('ok',$res_arr['body'] );
+    }
+
+
 }