1. Go to this page and download the library: Download ttvcloud/vcloud-sdk-php 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/ */
ttvcloud / vcloud-sdk-php example snippets
composer
$client = Vod::getInstance();
// call below method if you dont set ak and sk in ~/.vcloud/config
// $client->setAccessKey($ak);
// $client->setSecretKey($sk);
$expire = 60; // 请求的签名有效期
echo "\nSTS2鉴权签名\n";
$space = "";
$response = $client->getVideoPlayAuthWithExpiredTime([], [], [], $expire);
echo json_encode($response);
echo "\nSTS2鉴权签名,过期时间默认1小时\n";
$vid = "";
$response = $client->getVideoPlayAuth([], [], []);
echo json_encode($response);