You are here

function brightcove_update_playlist in Brightcove Video Connect 7.3

Same name and namespace in other branches
  1. 7.4 brightcove.module \brightcove_update_playlist()
  2. 7.5 brightcove.module \brightcove_update_playlist()

Wrapper function around playlist update.

Parameters

$metadata:

Return value

bool|object

1 call to brightcove_update_playlist()
brightcove_playlist_edit_form_submit in ./brightcove.playlist.inc
brightcove_playlist_edit_form submit handler.

File

./brightcove.module, line 303
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_update_playlist($metadata) {
  $bc = brightcove_initialize();
  try {
    $playlist = $bc
      ->update('playlist', $metadata);
  } catch (Exception $error) {
    drupal_set_message(t('Playlist upload to Brightcove failed. Error: @error', array(
      '@error' => $error,
    )), 'error');
    return FALSE;
  }

  // Invalidate playlist cache.
  brightcove_invalidate_cache('brightcove:playlist:' . $playlist->id);
  brightcove_invalidate_cache('brightcove:playlist:list', TRUE);
  return $playlist;
}