diff --git a/doc.md b/doc.md index 135883a..29e147f 100644 --- a/doc.md +++ b/doc.md @@ -385,7 +385,11 @@ Upyun::process( string $source, array $tasks ) ``` 该方法是基于[又拍云云处理](http://docs.upyun.com/cloud/) 服务实现,可以实现音视频的转码、切片、剪辑;文件的压缩解压缩;文件拉取功能 -所有需要调用该方法处理的资源,必须已经上传到云存储服务,未上传到云存储的文件,同时需要云处理功能,请使用 `write` 方法。 + + 注意: + - 所有需要调用该方法处理的资源,必须已经上传到云存储服务 + - 使用 `process` 之前,必须配置 `config->processNotifyUrl`,否则会提交任务失败 + 例如视频转码: ``` process($source, array( diff --git a/src/Upyun/Api/Pretreat.php b/src/Upyun/Api/Pretreat.php index ff262fa..6d15a64 100644 --- a/src/Upyun/Api/Pretreat.php +++ b/src/Upyun/Api/Pretreat.php @@ -17,6 +17,9 @@ class Pretreat public function __construct(Config $config) { + if (!$config->processNotifyUrl) { + throw new \Exception("should config prosessNotifyUrl first."); + } $this->config = $config; } @@ -29,7 +32,7 @@ public function process($source, $tasks) ]); $params = array( - 'bucket_name' => $this->config->bucketName, + 'service' => $this->config->bucketName, 'notify_url' => $this->config->processNotifyUrl, 'source' => $source, 'tasks' => $encodedTasks, diff --git a/src/Upyun/Upyun.php b/src/Upyun/Upyun.php index 3ec5f1f..5b22a40 100644 --- a/src/Upyun/Upyun.php +++ b/src/Upyun/Upyun.php @@ -297,7 +297,11 @@ public function purge($urls) * 异步云处理 * * 该方法是基于[又拍云云处理](http://docs.upyun.com/cloud/) 服务实现,可以实现音视频的转码、切片、剪辑;文件的压缩解压缩;文件拉取功能 - * 所有需要调用该方法处理的资源,必须已经上传到云存储服务,未上传到云存储的文件,同时需要云处理功能,请使用 `write` 方法。 + * + * 注意: + * - 所有需要调用该方法处理的资源,必须已经上传到云存储服务 + * - 使用 `process` 之前,必须配置 `config->processNotifyUrl`,否则会提交任务失败 + * * 例如视频转码: * ``` * process($source, array( @@ -309,7 +313,6 @@ public function purge($urls) * ... // 同时还可以添加其他任务 * )) * ``` - * 注意,被处理的资源需要已经上传到又拍云云存储 * * @param string $source 需要预处理的图片、音视频资源在又拍云存储的路径 * @param array $tasks 需要处理的任务