You are here

function brightcove_video_cache_set in Brightcove Video Connect 6.2

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

Caches the status of a video for faster validation.

This function also helps work around the lag in Brightcove API when videos are uploaded.

Parameters

$id: The Brightcove identifier for the video.

$video: The video object to be cached.

2 calls to brightcove_video_cache_set()
brightcove_cck_upload_form_submit in brightcove_cck/brightcove_cck.module
Submit callback for brightcove_cck_upload_form.
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 457
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_set($id, $video) {
  $id = (int) $id;
  $key = "bc:video:{$id}";
  cache_set($key, $video, 'cache', $_SERVER['REQUEST_TIME'] + 300);
}