You need to enable JavaScript to run this app.
文档中心
文档控制台
注册
veImageX

veImageX

复制全文
下载 pdf
PHP SDK
离线转码
复制全文
下载 pdf
离线转码

阅读本文,您可以获取 PHP SDK 离线转码的接口调用示例,实现快速开发。

说明

本文的调用示例包含接口的部分参数。由于参数间可能存在互斥关系,在调用时,请您参考注释,进行调整。

调用说明

  • 本文提供的接口调用示例均通过 AK 和 SK 初始化实例。
  • 接口的参数说明和错误码等信息可通过接口文档查看。

前提条件

调用接口前,请先完成 PHP SDK 的安装及初始化操作。

调用示例

本节为您介绍离线转码相关接口的功能和调用示例。

创建任务队列

您可以调用 CreateImageTranscodeQueue 接口创建任务队列。详细的参数说明可参见 CreateImageTranscodeQueue 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->createImageTranscodeQueue($body);
print_r($response);

删除任务队列

您可以调用 DeleteImageTranscodeQueue 接口删除任务队列。详细的参数说明可参见 DeleteImageTranscodeQueue 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->deleteImageTranscodeQueue($body);
print_r($response);

更新任务队列配置

您可以调用 UpdateImageTranscodeQueue 接口更新任务队列配置。详细的参数说明可参见 UpdateImageTranscodeQueue 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->updateImageTranscodeQueue($body);
print_r($response);

更新任务队列状态

您可以调用 UpdateImageTranscodeQueueStatus 接口更新任务队列状态。详细的参数说明可参见 UpdateImageTranscodeQueueStatus 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->updateImageTranscodeQueueStatus($body);
print_r($response);

获取任务队列

您可以调用 GetImageTranscodeQueues 接口获取任务队列。详细的参数说明可参见 GetImageTranscodeQueues 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$query = [];

$response = $client->getImageTranscodeQueues($query);
print_r($response);

提交转码任务

您可以调用 CreateImageTranscodeTask 接口提交转码任务。详细的参数说明可参见 CreateImageTranscodeTask 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->createImageTranscodeTask($body);
print_r($response);

手动触发条目维度回调

您可以调用 CreateImageTranscodeCallback 接口手动触发条目维度回调。详细的参数说明可参见 CreateImageTranscodeCallback 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->createImageTranscodeCallback($body);
print_r($response);

删除任务执行详情

您可以调用 DeleteImageTranscodeDetail 接口删除任务执行详情。详细的参数说明可参见 DeleteImageTranscodeDetail 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [];

$response = $client->deleteImageTranscodeDetail($body);
print_r($response);

获取任务执行详情

您可以调用 GetImageTranscodeDetails 接口获取任务执行详情。详细的参数说明可参见 GetImageTranscodeDetails 接口文档。

接口调用示例如下所示。

<?php
include_once(__DIR__ . '/../../../../vendor/autoload.php');

use Volc\Service\ImageX\V2\Imagex;

$client = Imagex::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$query = [];

$response = $client->getImageTranscodeDetails($query);
print_r($response);
最近更新时间:2024.12.05 18:30:55
这个页面对您有帮助吗?
有用
有用
无用
无用