You are here

function brightcove_get_playlists in Brightcove Video Connect 7.5

Same name and namespace in other branches
  1. 7.7 brightcove.playlist.inc \brightcove_get_playlists()
  2. 7.3 brightcove.playlist.inc \brightcove_get_playlists()
  3. 7.4 brightcove.playlist.inc \brightcove_get_playlists()
  4. 7.6 brightcove.playlist.inc \brightcove_get_playlists()

Get the playlists from Brightcove.

This function is a cached wrapper around BCMAPI::find('allplaylists').

Parameters

bool $cache_reset: (optional) True to reset the cache.

Return value

bool|array Array of playlists or FALSE if none found. @see http://support.brightcove.com/en/docs/media-api-objects-reference#Playlist

2 calls to brightcove_get_playlists()
brightcove_field_get_matched_playlists in brightcove_field/brightcove_field.playlist.inc
Return the playlists which contain the given string.
brightcove_playlist_overview_page in ./brightcove.playlist.inc
Renders the playlist overview page.

File

./brightcove.playlist.inc, line 64
This file contains function over the brightcove playlist feature.

Code

function brightcove_get_playlists($cache_reset = FALSE) {
  $cid = 'brightcove:playlist:list';
  $cache = brightcove_cache_get($cid);
  if (!$cache_reset && $cache && !empty($cache->data)) {
    return $cache->data;
  }
  $playlists = FALSE;
  $bc = brightcove_initialize();
  try {
    $playlists = $bc ? $bc
      ->find('allplaylists') : NULL;
  } catch (Exception $e) {
    watchdog('brightcove', 'Loading brightcove playlists failed.', array(), WATCHDOG_ERROR);
  }
  if ($playlists) {
    brightcove_cache_set($cid, $playlists);
  }
  return $playlists;
}