- App/HttpController/Index.php
public function getVideoInfo(){
$videoId='0fda2220f2504ba9b549307039166145';
$obj=new AliVod();
$result=$obj->getPlayInfo($videoId);
print_r($result);
}
- App/Lib/AliyunSdk/AliVod.php
public function getPlayInfo($videoId=0){
if(empty($videoId)){
return [];
}
$request=new vod\GetPlayInfoRequest();
$request->setVideoId($videoId);
$request->setAcceptFormat('JSON');
return $this->client->getAcsResponse($request);
}