You are here

function brightcove_video_cache_get in Brightcove Video Connect 7.2

Same name and namespace in other branches
  1. 6.2 brightcove.module \brightcove_video_cache_get()
  2. 6 brightcove.module \brightcove_video_cache_get()

Fetches a brighcove video object from the cache, if available.

Parameters

The Brightcove identifier for the video.:

Return value

Object the Brightcove video object.

3 calls to brightcove_video_cache_get()
brightcove_field_browser_validate in brightcove_field/brightcove_field.module
Validate callback for the field.
brightcove_field_browser_value in brightcove_field/brightcove_field.module
Callback for Brightcove field browser widget. Will return a field value in "video-name [id:videoId]" format.
brightcove_field_field_validate in brightcove_field/brightcove_field.module
Implements hook_field_validate().

File

./brightcove.module, line 453
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_video_cache_get($id) {
  $id = (int) $id;
  $key = "video_{$id}";
  if ($id && isset($_SESSION['brightcove'][$key])) {
    return $_SESSION['brightcove'][$key];
  }
  return NULL;
}