全部产品

云剪辑工程管理

本文介绍如何通过ICE PHP SDK进行云剪辑工程管理。

云剪辑工程管理

通过SDK对云剪辑工程进行增删改查操作。

标题为创建云剪辑工程的必要参数,只有设置了timeline的云剪辑工程才能 提交剪辑合成作业

搜索云剪辑工程

通过 SearchEditingProjectRequest 接口对云剪辑工程进行检索。

支持通过创建时间、云剪辑工程状态 对云剪辑工程进行检索。

支持NextToken参数对云剪辑工程进行分页查询。

详见 搜索云剪辑工程 API。

代码示例

<?php

require_once '../ice-20201109/autoload.php';

use AlibabaCloud\SDK\ICE\V20201109\ICE;
use AlibabaCloud\SDK\ICE\V20201109\Models;
use AlibabaCloud\SDK\ICE\V20201109\Models\SearchEditingProjectRequest;
use AlibabaCloud\SDK\ICE\V20201109\Models\CreateEditingProjectRequest;
use AlibabaCloud\SDK\ICE\V20201109\Models\GetEditingProjectRequest;
use AlibabaCloud\SDK\ICE\V20201109\Models\UpdateEditingProjectRequest;
use AlibabaCloud\SDK\ICE\V20201109\Models\DeleteEditingProjectsRequest;
use Darabonba\OpenApi\Models\Config;

try {
    $config = new Config();
    $config->accessKeyId = "<yourAccessKeyId>";
    $config->accessKeySecret = "<yourAccessKeySecret>";
    $config->regionId = "cn-shanghai";
    $config->endpoint = "ice.cn-shanghai.aliyuncs.com";
    $client = new ICE($config);
    
    // 搜索云剪辑工程
    $request = new SearchEditingProjectRequest();
    $response = $client->searchEditingProject($request);
    var_dump($response);
    
    // 创建云剪辑工程
    $request = new CreateEditingProjectRequest();
    $request->title = "测试工程名字";
    $request->description = "测试工程描述";
    $request->timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"}]}]}";
    $request->coverURL = "http://xxxx/coverUrl.jpg";
    $response = $client->createEditingProject($request);
    $projectId = $response->body->project->projectId;
    var_dump($response);
    
    // 获取单个云剪辑工程
    $request = new GetEditingProjectRequest();
    $request->projectId = $projectId;
    $response = $client->getEditingProject($request);
    var_dump($response);
    
    // 修改云剪辑工程
    $request = new UpdateEditingProjectRequest();
    $request->projectId = $projectId;
    $request->timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"}]}]}";
    $response = $client->updateEditingProject($request);
    var_dump($response);
    
    // 删除云剪辑工程
    $request = new DeleteEditingProjectsRequest();
    $request->projectIds = $projectId;
    $response = $client->deleteEditingProjects($request);
    var_dump($response);

} catch (TeaUnableRetryError $e) {
    var_dump($e->getMessage());
    var_dump($e->getErrorInfo());
    var_dump($e->getLastException());
    var_dump($e->getLastRequest());
}