src/BaiduBce/Services/Lss/LssClient.php
public function createStream($domain, $options = array())
    {
        list($config,
            $app,
            $publish,
            $scene,
            $recording,
            $notification,
            $thumbnail,
            $thumbnails,
            $watermarks,
            $destinationPushUrl
        ) = $this->parseOptions(
            $options,
            'config',
            'app',
            'publish',
            'scene',
            'recording',
            'notification',
            'thumbnail',
            'thumbnails',
            'watermarks',
            'destinationPushUrl');

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

        $body = array();

        if ($app !== null) {
            $body['app'] = $app;
        }
        if ($publish !== null) {
            $body['publish'] = $publish;
        }
        if ($scene !== null) {
            $body['scene'] = $scene;
        }
        if ($recording !== null) {
            $body['recording'] = $recording;
        }
        if ($notification !== null) {
            $body['notification'] = $notification;
        }
        if ($thumbnail !== null) {
            $body['thumbnail'] = $thumbnail;
        }
        if ($thumbnails !== null) {
            $body['thumbnails'] = $thumbnails;
        }
        if ($watermarks !== null) {
            $body['watermarks'] = $watermarks;
        }
        if ($destinationPushUrl !== null) {
            $body['destinationPushUrl'] = $destinationPushUrl;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            "/domain/$domain/stream"
        );
    }
public function createStream($domain, $options = array())
    {
        list($config,
            $app,
            $publish,
            $scene,
            $recording,
            $notification,
            $thumbnail,
            $thumbnails,
            $watermarks,
            $destinationPushUrl
        ) = $this->parseOptions(
            $options,
            'config',
            'app',
            'publish',
            'scene',
            'recording',
            'notification',
            'thumbnail',
            'thumbnails',
            'watermarks',
            'destinationPushUrl');

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

        $body = array();

        if ($app !== null) {
            $body['app'] = $app;
        }
        if ($publish !== null) {
            $body['publish'] = $publish;
        }
        if ($scene !== null) {
            $body['scene'] = $scene;
        }
        if ($recording !== null) {
            $body['recording'] = $recording;
        }
        if ($notification !== null) {
            $body['notification'] = $notification;
        }
        if ($thumbnail !== null) {
            $body['thumbnail'] = $thumbnail;
        }
        if ($thumbnails !== null) {
            $body['thumbnails'] = $thumbnails;
        }
        if ($watermarks !== null) {
            $body['watermarks'] = $watermarks;
        }
        if ($destinationPushUrl !== null) {
            $body['destinationPushUrl'] = $destinationPushUrl;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            "/domain/$domain/stream"
        );
    }
public function createStream ( $ domain , $ options = array ( ) ) { list ( $ config , $ app , $ publish , $ scene , $ recording , $ notification , $ thumbnail , $ thumbnails , $ watermarks , $ destinationPushUrl ) = $ this -> parseOptions ( $ options , 'config' , 'app' , 'publish' , 'scene' , 'recording' , 'notification' , 'thumbnail' , 'thumbnails' , 'watermarks' , 'destinationPushUrl' ) ; if ( empty ( $ domain ) ) { throw new BceClientException ( "The parameter domain " . "should NOT be null or empty string" ) ; } $ body = array ( ) ; if ( $ app !== null ) { $ body [ 'app' ] = $ app ; } if ( $ publish !== null ) { $ body [ 'publish' ] = $ publish ; } if ( $ scene !== null ) { $ body [ 'scene' ] = $ scene ; } if ( $ recording !== null ) { $ body [ 'recording' ] = $ recording ; } if ( $ notification !== null ) { $ body [ 'notification' ] = $ notification ; } if ( $ thumbnail !== null ) { $ body [ 'thumbnail' ] = $ thumbnail ; } if ( $ thumbnails !== null ) { $ body [ 'thumbnails' ] = $ thumbnails ; } if ( $ watermarks !== null ) { $ body [ 'watermarks' ] = $ watermarks ; } if ( $ destinationPushUrl !== null ) { $ body [ 'destinationPushUrl' ] = $ destinationPushUrl ; } return $ this -> sendRequest ( HttpMethod :: POST , array ( 'config' => $ config , 'body' => json_encode ( $ body ) , ) , "/domain/$domain/stream" ) ; }
Create a stream.

@param $domain string, name of play domain
@param $stream string, name of stream
@param array $options Supported options:
{
config: the optional bce configuration, which will overwrite the
default client configuration that was passed in constructor.
}
@return mixed session detail
@throws BceClientException
Create a stream .