12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- require dirname(__FILE__, 2) . '/vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'scheme' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId,
- 'secretKey' => $secretKey)));
- try {
-
- $result = $cosClient->CreateMediaJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Transcode',
- 'CallBack' => '',
- 'Input' => array(
- 'Object' => 'example.mp4'
- ),
- 'Operation' => array(
- array(
- 'Tag' => 'Transcode',
- 'TemplateId' => 't04e1ab86554984f1aa17cxxxxxxxxxxxxxx',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'video01.mp4',
- ),
- 'WatermarkTemplateId' => array(
- 't112d18d9b2a9b430e91dxxxxxxxxxxxxxx',
- ),
- ),
- array(
- 'Tag' => 'Transcode',
- 'TemplateId' => 't04e1ab86554984f1aa17xxxxxxxxxxxxxx',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'video02.mp4',
- ),
- 'WatermarkTemplateId' => array(
- 't1bf713bb5c6a5496e859axxxxxxxxxxxxxx',
- ),
- ),
- ),
- ));
- print_r($result);
- } catch (\Exception $e) {
-
- echo($e);
- }
|