src/BaiduBce/Services/Vod/VodClient.php
public function createMediaFromBosObject($bucket, $key, $title, $description = '', $options = array())
    {
        if (empty($bucket)) {
            throw new BceClientException("The parameter fileName should NOT be null or empty string");
        }
        if (empty($key)) {
            throw new BceClientException("The parameter fileName should NOT be null or empty string");
        }
        if (empty($title)) {
            throw new BceClientException("The parameter title should NOT be null or empty string");
        }
        // apply media
        $uploadInfo = $this->applyMedia($options);
        // copy bos object
        $this->bosClient->copyObject($bucket, $key, $uploadInfo->sourceBucket, $uploadInfo->sourceKey);
        // process media
        // try to cal the extension of the file
        $extension = strtolower(pathinfo($key, PATHINFO_EXTENSION));
        if (!preg_match("/^[a-z0-9]{0,10}$/", $extension)) {
            $extension = '';
        }
        $options['extension'] = $extension;
        return $this->processMedia($uploadInfo->mediaId, $title, $description, $options);
    }
public function createMediaFromBosObject($bucket, $key, $title, $description = '', $options = array())
    {
        if (empty($bucket)) {
            throw new BceClientException("The parameter fileName should NOT be null or empty string");
        }
        if (empty($key)) {
            throw new BceClientException("The parameter fileName should NOT be null or empty string");
        }
        if (empty($title)) {
            throw new BceClientException("The parameter title should NOT be null or empty string");
        }
        // apply media
        $uploadInfo = $this->applyMedia($options);
        // copy bos object
        $this->bosClient->copyObject($bucket, $key, $uploadInfo->sourceBucket, $uploadInfo->sourceKey);
        // process media
        // try to cal the extension of the file
        $extension = strtolower(pathinfo($key, PATHINFO_EXTENSION));
        if (!preg_match("/^[a-z0-9]{0,10}$/", $extension)) {
            $extension = '';
        }
        $options['extension'] = $extension;
        return $this->processMedia($uploadInfo->mediaId, $title, $description, $options);
    }
public function createMediaFromBosObject ( $ bucket , $ key , $ title , $ description = '' , $ options = array ( ) ) { if ( empty ( $ bucket ) ) { throw new BceClientException ( "The parameter fileName should NOT be null or empty string" ) ; } if ( empty ( $ key ) ) { throw new BceClientException ( "The parameter fileName should NOT be null or empty string" ) ; } if ( empty ( $ title ) ) { throw new BceClientException ( "The parameter title should NOT be null or empty string" ) ; } // apply media $ uploadInfo = $ this -> applyMedia ( $ options ) ; // copy bos object $ this -> bosClient -> copyObject ( $ bucket , $ key , $ uploadInfo -> sourceBucket , $ uploadInfo -> sourceKey ) ; // process media // try to cal the extension of the file $ extension = strtolower ( pathinfo ( $ key , PATHINFO_EXTENSION ) ) ; if ( ! preg_match ( "/^[a-z0-9]{0,10}$/" , $ extension ) ) { $ extension = '' ; } $ options [ 'extension' ] = $ extension ; return $ this -> processMedia ( $ uploadInfo -> mediaId , $ title , $ description , $ options ) ; }
Create a vod media via bos object.

@param $bucket string, bos bucket name
@param $key    string, bos object key
@param $title  string, the title of the media
@param $description string, the description of the media, optional
@param array $options Supported options:
{
config: the optional bce configuration, which will overwrite the
default vod client configuration that was passed in constructor.
}
@return mixed created vod media info
@throws BceClientException
Create a vod media via bos object .