12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?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->createMediaSnapshotJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Snapshot',
- 'CallBack' => 'https://example.com/callback',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'TemplateId' => 'asdfafiahfiushdfisdhfuis',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'snapshot-${Number}.jpg',
- ),
- ),
- ));
-
- print_r($result);
-
-
- $result = $cosClient->createMediaSnapshotJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Snapshot',
- 'CallBack' => 'https://example.com/callback',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'snapshot-${Number}.jpg',
- ),
- 'Snapshot' => array(
- 'Mode' => 'Average',
- 'Start' => 3,
- 'TimeInterval' => '',
- 'Count' => 3,
- 'Width' => '1280',
- 'Height' => '',
- ),
- ),
- ));
-
- print_r($result);
-
- } catch (\Exception $e) {
-
- echo($e);
- }
|