Wednesday, January 30, 2013

How to use brightcove video Search in drupal


Brightcove video cloud, a cloud based video hosting and publishing solution. Drupal is one of the most commonly used open source CMS.

To integrates brightcove video cloud into drupal, drupal community provides one module called Brightcove module. . Using this module you can add Brightcove video to your content and access the information from the Video Cloud in your site.
 In brightcove module they are using Brightcove Media API and this APi provides various methods to retrieve properties from brightcove video cloud. But this module is mainly focusing on find method. So here I am trying to explain how to use search method in drupal. Search method is also a simple function to retrieve properties and information from Brightcove.

To call search method we need to pass three arguments - method, terms and params.Using this method we can search custom fields from brightcove. Here I'm explaining how to search custom fields value from brightcove using search method.

Below code shows how to search for a video with "jobs" in the title AND tags.
 
// Define our parameters
$params = array(
    'video_fields' => 'id,name,shortDescription'
);

// Set our search terms
$terms = array(
    'all' => 'display_name:jobs,tag:jobs'
);
  
 // Make our API call 
$videos = $bc->search('video', $terms, $params);

 Below code will explain how to search video with custom fields. 
custom field name is drupal_user and this field is used for storing uploaded user name(Drupal Username) in brightcove.


// Define our parameters
$params = array(
    'video_fields' => 'id,name,shortDescription'
);

// Set our search terms
$terms = array(
    'all' => 'drupal_user:jobs'
);
  
 // Make our API call 
$videos = $bc->search('video', $terms, $params);



0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Maintained by Web Themes