You are here

function brightcove_player_load in Brightcove Video Connect 7.5

Same name and namespace in other branches
  1. 7.7 brightcove.module \brightcove_player_load()
  2. 7.2 brightcove.module \brightcove_player_load()
  3. 7.3 brightcove.module \brightcove_player_load()
  4. 7.4 brightcove.module \brightcove_player_load()
  5. 7.6 brightcove.module \brightcove_player_load()

Load a player.

Parameters

$name:

Return value

mixed

2 calls to brightcove_player_load()
brightcove_default_player in ./brightcove.module
Get the default player.
brightcove_field_preprocess_brightcove_field_embed in brightcove_field/theme.inc
The brightcove_field_embed theme function preprocess function.

File

./brightcove.module, line 761
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_player_load($name) {

  // Try to get the default player.
  if (empty($name)) {
    $default_player = variable_get('brightcove_player_default', NULL);

    // If no default player is set, show an error message.
    if (is_null($default_player)) {
      drupal_set_message(t('Default player is not set, please set one on the !link page.', array(
        '!link' => l(t('Brightcove settings'), 'admin/config/media/brightcove/players'),
      )), 'error');
    }
    return $default_player;
  }

  // Return the player with the given name.
  $players = brightcove_player_load_all();
  return $players[$name];
}