src/BaiduBce/Services/Media/MediaClient.php
public function createThumbnailJob($pipelineName, array $source, $options = array()) {
        list($config, $target, $capture) = $this->parseOptions(
            $options,
            'config',
            'target',
            'capture'
        );

        if (empty($pipelineName)) {
            throw new BceClientException("The parameter pipelineName " 
                ."should NOT be null or empty string");
        }

        if (empty($source)) {
            throw new BceClientException("The parameter source " 
                ."should NOT be null or empty string");
        }
        
        $body = array(
            'pipelineName' => $pipelineName,
            'source' => $source,
        );

        if ($target !== null) {
            $body['target'] = $target;
        }
        if ($capture !== null) {
            $body['capture'] = $capture;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            '/job/thumbnail'
        );
    }
public function createThumbnailJob($pipelineName, array $source, $options = array()) {
        list($config, $target, $capture) = $this->parseOptions(
            $options,
            'config',
            'target',
            'capture'
        );

        if (empty($pipelineName)) {
            throw new BceClientException("The parameter pipelineName " 
                ."should NOT be null or empty string");
        }

        if (empty($source)) {
            throw new BceClientException("The parameter source " 
                ."should NOT be null or empty string");
        }
        
        $body = array(
            'pipelineName' => $pipelineName,
            'source' => $source,
        );

        if ($target !== null) {
            $body['target'] = $target;
        }
        if ($capture !== null) {
            $body['capture'] = $capture;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            '/job/thumbnail'
        );
    }
public function createThumbnailJob ( $ pipelineName , array $ source , $ options = array ( ) ) { list ( $ config , $ target , $ capture ) = $ this -> parseOptions ( $ options , 'config' , 'target' , 'capture' ) ; if ( empty ( $ pipelineName ) ) { throw new BceClientException ( "The parameter pipelineName " . "should NOT be null or empty string" ) ; } if ( empty ( $ source ) ) { throw new BceClientException ( "The parameter source " . "should NOT be null or empty string" ) ; } $ body = array ( 'pipelineName' => $ pipelineName , 'source' => $ source , ) ; if ( $ target !== null ) { $ body [ 'target' ] = $ target ; } if ( $ capture !== null ) { $ body [ 'capture' ] = $ capture ; } return $ this -> sendRequest ( HttpMethod :: POST , array ( 'config' => $ config , 'body' => json_encode ( $ body ) , ) , '/job/thumbnail' ) ; }
Create a job of generating thumbnail

@param string $pipelineName the pipeline name
@param array $source
{
key: The source media object's key
}
@param array $options Supported options:
{
config: The optional bce configuration, which will overwrite the
default client configuration that was passed in constructor.
target: { The target thumbnail info set
keyPrefix: Prefix of the target thumbnail
format: Target thumbnail file format, enum(jpg, png), only jpg is supported now
sizingPolicy: enum(keep, shrinkToFit, stretch)
widthInPixel: The target thumbnail width in pixel
heightInPixel: The target thumbnail height in pixel
}
capture: { The rules to generate the thumbnail
mode: enum(auto, manual)
startTimeInSecond: The start time
endTimeInSecond: The end time
intervalInSecond: The time interval
}
}
@return mixed
@throws BceClientException
Create a job of generating thumbnail