Add video

Add a video into Brid

addVideo - Add a new video into the Brid platform.

Description

mixed addVideo ( array $_post , bool $encode );
This method is type of POST.

Parameters

@param (array) $_post - Array of post data (required)
@param (string) name - Video title (max 250 chars)
@param (string) description - Video description
@param (string) publish - Publish date (format required d-m-Y)
@param (string) image - Snapshot image Url
@param (int) channel_id - Channel id (required)
@param (int) partner_id - Site id (required)
@param (int) image_width - Snapshot image width
@param (int) image_height - Snapshot image height
@param (string) mp4 - Video Url source (required)
@param (string) mp4_hd - Video Url source HD
@param (int) mp4_hd_on - Try to play Video Url source HD (0,1)
@param (int) file_size - Video source filesize
@param (date) publish - Publish date format (d-m-Y)
@param (string) landing_page - Landing page Url
@param (int) age_gate_id - Age gate setting (0,1,2)
@param (int) tags - CSV tags
@param (bool) $encode - Encode response into JSON

Examples

Get JSON response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'name'=>'My Video Title' , 
            'description'=>'My Video Description text' , 
            'channel_id'=>1 ,
            'partner_id'=>1 ,
            'tags'=>'my,video,tags' ,
            'image'=>'http://www.your-site.com/path_to_video_image.jbg' , 
            'mp4'=> 'http://www.your-site.com/path_to_video.mp4' , 
            'publish'=>'25-12-2013'

    );

    print_r($api->addVideo($post));
?>

Result

{"success":true,"status":"success","message":"The Video has been saved.","startEncoding":false,"videoId":"3383","externalId":"","encoding":"","thumb":[],"redirect":"\/videos\/index\/"}

Get PHP response:

<?php 
    require_once('lib/api.php');
    $api = new BridApi();
    $post = array(
            'name'=>'My Video Title' , 
            'description'=>'My Video Description text' , 
            'channel_id'=>1 ,
            'partner_id'=>1 ,
            'tags'=>'my,video,tags' ,
            'image'=>'http://www.your-site.com/path_to_video_image.jbg' , 
            'mp4'=> 'http://www.your-site.com/path_to_video.mp4' , 
            'publish'=>'25-12-2013'

    );

    print_r($api->addVideo($post, true));
?>  

Result

stdClass Object ( [success] => 1 [status] => success [message] => The Video has been saved. [startEncoding] => [videoId] => 3384 [externalId] => [encoding] => [thumb] => Array ( ) [redirect] => /videos/index/ )