Home > Backend Development > PHP Tutorial > Youpaiyun asynchronous audio and video processing callback cannot get parameters

Youpaiyun asynchronous audio and video processing callback cannot get parameters

WBOY
Release: 2016-07-06 13:51:59
Original
1092 people have browsed it

Youpaiyun, after asynchronous audio and video processing, the callback function always obtains the POST parameters.

<code>function actionVideoProcessCallback(){

        /**
        * 官方SDK提供的方法,执行后,因为参数为空,所以验证失败。
        */
        $av = new AvPretreatment('xxx', 'xxx');
        $validation = new CallbackValidation($av);
        if($validation->verifySign()) {
            echo '验证成功';
        } else {
            echo '验证失败';
        }


        /**
        * 直接通过POST也无法获取。
        */
        $status_code = $_POST['status_code'];//     integer     处理结果状态码,200 表示成功处理
        $bucket_name = $_POST['bucket_name'];
        $signature = $_POST['signature'];
        $path = $_POST['path'];//array     输出文件保存路径
        $description = $_POST['description']; //string     处理结果描述
        $task_id = $_POST['task_id'];//任务对应的 task_id

        //获取进度
        //$sugar = new AvPretreatment('xxx', 'xxx');//操作员的帐号密码
        //$result = $sugar->getTasksStatus($task_id,'xxx');

    }</code>
Copy after login
Copy after login

Although the callback did not get the parameters, the execution was successful and the file was processed.

How to solve it?

Reply content:

Youpaiyun, after asynchronous audio and video processing, the callback function always obtains the POST parameters.

<code>function actionVideoProcessCallback(){

        /**
        * 官方SDK提供的方法,执行后,因为参数为空,所以验证失败。
        */
        $av = new AvPretreatment('xxx', 'xxx');
        $validation = new CallbackValidation($av);
        if($validation->verifySign()) {
            echo '验证成功';
        } else {
            echo '验证失败';
        }


        /**
        * 直接通过POST也无法获取。
        */
        $status_code = $_POST['status_code'];//     integer     处理结果状态码,200 表示成功处理
        $bucket_name = $_POST['bucket_name'];
        $signature = $_POST['signature'];
        $path = $_POST['path'];//array     输出文件保存路径
        $description = $_POST['description']; //string     处理结果描述
        $task_id = $_POST['task_id'];//任务对应的 task_id

        //获取进度
        //$sugar = new AvPretreatment('xxx', 'xxx');//操作员的帐号密码
        //$result = $sugar->getTasksStatus($task_id,'xxx');

    }</code>
Copy after login
Copy after login

Although the callback did not get the parameters, the execution was successful and the file was processed.

How to solve it?

You can look at this document and write directly into the callback. Callback notification

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template