Skip to content

Commit 6cd5287

Browse files
authored
Auditadd (#267)
* 审核新增 * 审核新增 * 直播流审核
1 parent 5408e16 commit 6cd5287

File tree

6 files changed

+432
-1
lines changed

6 files changed

+432
-1
lines changed

sample/cancelLiveVideoAuditing.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
require dirname(__FILE__) . '/../vendor/autoload.php';
4+
5+
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
6+
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
7+
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
8+
$cosClient = new Qcloud\Cos\Client(
9+
array(
10+
'region' => $region,
11+
'schema' => 'https', // 审核时必须为https
12+
'credentials'=> array(
13+
'secretId' => $secretId ,
14+
'secretKey' => $secretKey)));
15+
try {
16+
$result = $cosClient->cancelLiveVideoAuditing(array(
17+
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
18+
'Key' => '', // jobId
19+
));
20+
// 请求成功
21+
print_r($result);
22+
} catch (\Exception $e) {
23+
// 请求失败
24+
echo($e);
25+
}

sample/detectLiveVideo.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
require dirname(__FILE__) . '/../vendor/autoload.php';
4+
5+
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
6+
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
7+
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
8+
$cosClient = new Qcloud\Cos\Client(
9+
array(
10+
'region' => $region,
11+
'schema' => 'https', // 审核时必须为https
12+
'credentials'=> array(
13+
'secretId' => $secretId ,
14+
'secretKey' => $secretKey)));
15+
try {
16+
$result = $cosClient->detectLiveVideo(array(
17+
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
18+
'Type' => 'live_video',
19+
'Input' => array(
20+
'Url' => 'rtmp://example.com/live/123', // 直播流地址
21+
// 'DataId' => '',
22+
// 'UserInfo' => array(
23+
// 'TokenId' => '',
24+
// 'Nickname' => '',
25+
// 'DeviceId' => '',
26+
// 'AppId' => '',
27+
// 'Room' => '',
28+
// 'IP' => '',
29+
// 'Type' => '',
30+
// ),
31+
),
32+
'Conf' => array(
33+
'Callback' => '',
34+
// 'CallbackType' => 1,
35+
'BizType' => '07d41bbb5a3a93dca4xxxxxxxxxxx', // 直播流审核 BizType 必填,可联系工作人员生成后使用
36+
),
37+
));
38+
// 请求成功
39+
print_r($result);
40+
} catch (\Exception $e) {
41+
// 请求失败
42+
echo($e);
43+
}

src/Client.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
* @method object CreateMediaSDRtoHDRJobs(array $args) 提交 SDR to HDR 任务
137137
* @method object CreateMediaDigitalWatermarkJobs(array $args) 嵌入数字水印任务(添加水印)
138138
* @method object CreateMediaExtractDigitalWatermarkJobs(array $args) 提取数字水印任务(提取水印)
139+
* @method object DetectLiveVideo(array $args) 直播流审核
140+
* @method object CancelLiveVideoAuditing(array $args) 取消直播流审核
139141
* @see \Qcloud\Cos\Service::getService()
140142
*/
141143
class Client extends GuzzleClient {

src/CommandToRequestTransformer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ public function cosDomain2CiTransformer(CommandInterface $command, $request) {
294294
'CreateMediaSDRtoHDRJobs' => 1,
295295
'CreateMediaDigitalWatermarkJobs' => 1,
296296
'CreateMediaExtractDigitalWatermarkJobs' => 1,
297+
'DetectLiveVideo' => 1,
298+
'CancelLiveVideoAuditing' => 1,
297299
);
298300
if (key_exists($action, $ciActions)) {
299301
$bucketname = $command['Bucket'];

0 commit comments

Comments
 (0)