You are here

function theme_emvideo_video_preview in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 contrib/emvideo/emvideo.theme.inc \theme_emvideo_video_preview()
  2. 6 contrib/emvideo/emvideo.theme.inc \theme_emvideo_video_preview()

File

contrib/emvideo/emvideo.theme.inc, line 203
This defines the various theme functions for Embedded Video Field (emvideo).

Code

function theme_emvideo_video_preview($field, $item, $formatter, $node, $options = array()) {
  $output = '';
  if ($item['value'] && $item['provider']) {
    $embed = $item['value'];
    $width = isset($options['width']) ? $options['width'] : (isset($field['widget']['preview_width']) ? $field['widget']['preview_width'] : variable_get('emvideo_default_preview_width', EMVIDEO_DEFAULT_PREVIEW_WIDTH));
    $height = isset($options['height']) ? $options['height'] : (isset($field['widget']['preview_height']) ? $field['widget']['preview_height'] : variable_get('emvideo_default_preview_height', EMVIDEO_DEFAULT_PREVIEW_HEIGHT));
    $autoplay = isset($options['autoplay']) ? $options['autoplay'] : (isset($field['widget']['preview_autoplay']) ? $field['widget']['preview_autoplay'] : FALSE);
    $options['node'] = $node;
    $output = emfield_include_invoke('emvideo', $item['provider'], 'preview', $embed, $width, $height, $field, $item, $node, $autoplay, $options);
    $output = '<div class="emvideo emvideo-preview emvideo-' . check_plain($item['provider']) . '">' . $output . '</div>';
  }
  return $output;
}