メディアID (メディアワークフローでオンデマンドビデオに変換されたライブビデオ) がわからない場合、メディア入力 URL を使用することで、QueryMediaListByURL 上でメディア情報を照会することができます。

  1. <? phpinclude_once aliyun-php-sdk-core/Config.php’;use Mts\Request\V20140618 as Mts;date_default_timezone_set(‘PRC’);class QueryMediaListByURLDemo { private $client; private $region = ‘<region>’; private $accessKeyId = ‘<accessKeyId>’; private $accessKeySecret = ‘<accessKeySecret>’; function __construct() { $profile = DefaultProfile::getProfile($this->region, $this->accessKeyId, $this->accessKeySecret); $this->client = new DefaultAcsClient($profile); } function queryMediaListByUrl() { $request = new Mts\QueryMediaListByURLRequest(); $ossDomain = http://<input-bucket>.<region>.aliyuncs.com/‘; #ossObject must be RFC3986-encoded. $ossObject = $this->encodeByRFC3986(‘test/The Legend of the Swordsman.mp4’); $request->setFileURLs($ossDomain.$ossObject); $response = $this->client->getAcsResponse($request); echo json_encode($response); } function encodeByRFC3986($arg_1) { $encodeOssObject=””; $arraylist = explode(“/“, $arg_1); for($i = 0; $i < count($arraylist); $i++) { $tmp = rawurlencode($arraylist[$i]); $encodeOssObject = $encodeOssObject.$tmp; if ($i ! == count($arraylist) -1) { $encodeOssObject = $encodeOssObject.”/“; } } return $encodeOssObject; }}$demo = new QueryMediaListByURLDemo();$demo->queryMediaListByUrl();? >
  1. </article>
  2. </main>