You are here

function theme_brightcove_field_dialog_image in Brightcove Video Connect 7.2

Theme callback for dialog with image player.

1 string reference to 'theme_brightcove_field_dialog_image'
brightcove_field_theme in brightcove_field/brightcove_field.module
Implementation of hook_theme().

File

brightcove_field/brightcove_field.formatters.inc, line 11
Formatters for video field.

Code

function theme_brightcove_field_dialog_image($variables) {
  $element = $variables['element'];
  $style_data = str_replace('dialog_image_', '', $element['#formatter']);
  list($style, $field) = explode('__', $style_data);
  if (isset($element['#item']['video_id'])) {
    $video = brightcove_video_load($element['#item']['video_id']);
    $image = theme('image_style', array(
      'style_name' => $style,
      'path' => empty($video->thumbnailURL) ? brightcove_get_default_image() : brightcove_remote_image($video->{$field}),
    ));
    return theme("brightcove_field_formatter_dialog_player_{$field}", array(
      'element' => $element,
      'image' => $image,
      'style' => $style,
    ));
  }
  return '';
}