You are here

function brightcove_video_cache_get in Brightcove Video Connect 6.2

Same name and namespace in other branches
  1. 6 brightcove.module \brightcove_video_cache_get()
  2. 7.2 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.

4 calls to brightcove_video_cache_get()
brightcove_cck_browser_validate in brightcove_cck/brightcove_cck.module
Validate callback for the field.
brightcove_cck_browser_value in brightcove_cck/brightcove_cck.module
Callback for Brightcove CCK browser widget. Will return a field value in "video-name [id:videoId]" format.
brightcove_cck_field in brightcove_cck/brightcove_cck.module
Implementation of hook_field().
brightcove_video_load in ./brightcove.module
Loads Brightcove video from BC Media API. Uses a 5 minutes cache to speed up lookups.

File

./brightcove.module, line 472
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 = "bc:video:{$id}";
  $cache = cache_get($key, 'cache');
  if (!empty($cache->data)) {
    return $cache->data;
  }
  return NULL;
}