filestack/mixins/TransformationMixin.php
public function sendVideoConvert($resource, $transform_tasks,
                                     $security = null, $force = false)
    {
        $tasks_str = $this->createTransformStr($transform_tasks);
        $transform_url = $this->createTransformUrl(
            $this->api_key,
            'video',
            $resource,
            $tasks_str,
            $security
        );

        // force restart task?
        if ($force) {
            $transform_url .= '&force=true';
        }

        // call CommonMixin function
        $response = $this->sendRequest('GET', $transform_url);
        $status_code = $response->getStatusCode();

        // handle response
        if ($status_code !== 200) {
            throw new FilestackException($response->getBody(), $status_code);
        }

        $json_response = json_decode($response->getBody(), true);
        $uuid = $json_response['uuid'];

        return [
            'uuid'              => $uuid,
            'conversion_url'    => $transform_url
        ];
    }
public function sendVideoConvert($resource, $transform_tasks,
                                     $security = null, $force = false)
    {
        $tasks_str = $this->createTransformStr($transform_tasks);
        $transform_url = $this->createTransformUrl(
            $this->api_key,
            'video',
            $resource,
            $tasks_str,
            $security
        );

        // force restart task?
        if ($force) {
            $transform_url .= '&force=true';
        }

        // call CommonMixin function
        $response = $this->sendRequest('GET', $transform_url);
        $status_code = $response->getStatusCode();

        // handle response
        if ($status_code !== 200) {
            throw new FilestackException($response->getBody(), $status_code);
        }

        $json_response = json_decode($response->getBody(), true);
        $uuid = $json_response['uuid'];

        return [
            'uuid'              => $uuid,
            'conversion_url'    => $transform_url
        ];
    }
public function sendVideoConvert ( $ resource , $ transform_tasks , $ security = null , $ force = false ) { $ tasks_str = $ this -> createTransformStr ( $ transform_tasks ) ; $ transform_url = $ this -> createTransformUrl ( $ this -> api_key , 'video' , $ resource , $ tasks_str , $ security ) ; // force restart task? if ( $ force ) { $ transform_url .= '&force=true' ; } // call CommonMixin function $ response = $ this -> sendRequest ( 'GET' , $ transform_url ) ; $ status_code = $ response -> getStatusCode ( ) ; // handle response if ( $ status_code !== 200 ) { throw new FilestackException ( $ response -> getBody ( ) , $ status_code ) ; } $ json_response = json_decode ( $ response -> getBody ( ) , true ) ; $ uuid = $ json_response [ 'uuid' ] ; return [ 'uuid' => $ uuid , 'conversion_url' => $ transform_url ] ; }
Send video_convert request to API

@param string            $resource           url or filestack handle
@param array             $transform_tasks    array of transformation tasks
@param FilestackSecurity $security           Filestack Security object if
enabled

@throws FilestackException   if API call fails, e.g 404 file not found

@return string (uuid of conversion task)
Send video_convert request to API