|
@@ -260,6 +260,23 @@ class VideoDemand extends Base
|
|
|
$this->success('ok',$res_arr['body'] );
|
|
|
}
|
|
|
|
|
|
+ public function getVideoInfo($ali_vid)
|
|
|
+ {
|
|
|
+ $client = self::createClient($this->access_key, $this->access_secret);
|
|
|
+ $getVideoPlayAuthRequest = new GetPlayInfoRequest(['videoId'=>$ali_vid]);
|
|
|
+ $runtime = new RuntimeOptions([]);
|
|
|
+ try {
|
|
|
+ $res = $client->getPlayInfoWithOptions($getVideoPlayAuthRequest, $runtime);
|
|
|
+ $json_res = json_encode($res,true);
|
|
|
+ $res_arr = json_decode($json_res,true);
|
|
|
+ }catch (\Exception $error){
|
|
|
+ if (!($error instanceof TeaError)) {
|
|
|
+ $error = new TeaError([], $error->getMessage(), $error->getCode(), $error);
|
|
|
+ }
|
|
|
+ $this->error($error->message);
|
|
|
+ }
|
|
|
+ return $res_arr['body'];
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|