You are here

function brightcove_initialize in Brightcove Video Connect 6.2

Same name and namespace in other branches
  1. 7.2 brightcove.module \brightcove_initialize()
  2. 7.3 brightcove.module \brightcove_initialize()
  3. 7.4 brightcove.module \brightcove_initialize()
  4. 7.5 brightcove.module \brightcove_initialize()

Initializes the Brightcove Media API and returns an instance of the object.

Return value

BCMAPI Instance of the Brightcove Media API or FALSE if fails to initialize.

4 calls to brightcove_initialize()
brightcove_status in ./brightcove.module
brightcove_upload_video in ./brightcove.module
Upload video to Brightcove.
brightcove_video_load in ./brightcove.module
Loads Brightcove video from BC Media API. Uses a 5 minutes cache to speed up lookups.
_brightcove_initialize in ./brightcove.module
Initializes the Brightcove Media API and returns an instance of the object.

File

./brightcove.module, line 123
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_initialize() {
  $read_token = variable_get('brightcove_read_api_key', '');
  $write_token = variable_get('brightcove_write_api_key', '');
  if (empty($read_token)) {
    drupal_set_message(t('Cannot initialize Brightcove API. Contact site administrators.'));
    watchdog('brightcove', 'Brightcove Read API keys not found, cannot initialize Brightcove MAPI SDK.', array(), WATCHDOG_ERROR);
    return FALSE;
  }
  $bc = new BCMAPI($read_token, $write_token);
  return $bc;
}