You are here

function brightcove_field_preprocess_brightcove_field_embed in Brightcove Video Connect 7.3

Same name and namespace in other branches
  1. 7.4 brightcove_field/theme.inc \brightcove_field_preprocess_brightcove_field_embed()
  2. 7.5 brightcove_field/theme.inc \brightcove_field_preprocess_brightcove_field_embed()

The brightcove_field_embed theme function preprocess function.

Parameters

$variables:

File

brightcove_field/theme.inc, line 70
Theme funciton for the module.

Code

function brightcove_field_preprocess_brightcove_field_embed(&$variables) {
  if (!isset($variables['player'])) {
    watchdog('brightcove', 'Brightcove player is missing.', array(), WATCHDOG_ERROR);
  }
  $flashvars = array();
  $player = brightcove_player_load($variables['player']);
  $variables['id'] = 'myExperience-' . $variables['id'];
  $variables['bgcolor'] = '#FFFFFF';
  $variables['width'] = isset($variables['width']) ? $variables['width'] : BRIGHTCOVE_DEFAULT_VIDEO_WIDTH;
  $variables['height'] = isset($variables['height']) ? $variables['height'] : BRIGHTCOVE_DEFAULT_VIDEO_HEIGHT;
  if (isset($variables['brightcove_id'])) {
    $variables['player_id'] = isset($player->player_id) ? $player->player_id : '';
    $variables['player_key'] = isset($player->player_key) ? $player->player_key : '';
    if (drupal_strtolower($variables['type']) == 'brightcove') {
      $variables['is_vid'] = TRUE;
      $variables['brightcove_id'] = $variables['brightcove_id'];
    }
    elseif (drupal_strtolower($variables['type']) == 'brightcove-player') {
      $variables['is_vid'] = FALSE;
      $variables['brightcove_id'] = $variables['brightcove_id'];
    }
  }
}