You are here

function videojs_field_formatter_settings_summary in Video.js (HTML5 Video Player) 7.2

Same name and namespace in other branches
  1. 7.3 videojs.module \videojs_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./videojs.module, line 273
Provides an HTML5-compatible with Flash-fallback video player.

Code

function videojs_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $image_styles = image_style_options(FALSE);
  $output = t('Player dimensions: @widthxheight', array(
    '@widthxheight' => !empty($settings['width']) && !empty($settings['height']) ? $settings['width'] . 'x' . $settings['height'] : t('default'),
  ));
  if (!empty($settings['posterimage_field'])) {
    $imageinstance = field_info_instance($instance['entity_type'], $settings['posterimage_field'], $instance['bundle']);
    if ($imageinstance != NULL) {
      $output .= '<br/>';
      $output .= t('Poster image field') . ': ' . check_plain($imageinstance['label']);
    }
  }
  $output .= '<br/>';
  if (isset($image_styles[$settings['posterimage_style']])) {
    $output .= t('Poster image style') . ': ' . check_plain($image_styles[$settings['posterimage_style']]);
  }
  else {
    $output .= t('Poster image style') . ': ' . t('None');
  }
  return $output;
}