PHP code example of 57feng / aliyun-vod
1. Go to this page and download the library: Download 57feng/aliyun-vod library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
57feng / aliyun-vod example snippets
use Ym\AliyunVod\MediaRead;
use Ym\AliyunVod\MediaUpload;
………………省略实例化等过程
$data = [
'title' => 'title',
'filename' => 'filename.mp4',
'description' => 'filename.mp4',
'cover' => 'http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg',
'tags' => ['标签1','标签2']
];
// 获取视频上传地址和凭证
// $result = $this->mediaUpload->createUploadVideo($data);
// 刷新视频上传凭证
$videoId = '4b3d76bf31664f9d8c85f77be5349e7b';
$result = $this->mediaUpload->refreshUploadVideo($videoId);
// $result = $this->mediaUpload->uploadMediaByURL($url,$title); //url 拉去视屏上传
// 获取播放权限参数
// $result = $this->mediaRead->getPlayAuth(['video_id'=>$videoId]);
// 获取播放信息
// $result = $this->mediaRead->getPlayInfo(['video_id'=>$videoId]);
var_dump($result);
return $result;