You are here

function video_default_field_settings in Video 7

1 call to video_default_field_settings()
video_field_settings_form in ./video.field.inc
Implements hook_field_settings_form().

File

./video.module, line 579

Code

function video_default_field_settings($settings) {
  $form = array();

  // Default video field settings.
  $form['autoconversion'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable video conversion.'),
    '#description' => t('Use ffmpeg(Default) or Zencoder to automatically convert videos to web compatible types eg. FLV, Please make sure to configure your transcoder settings.'),
    '#default_value' => isset($settings['autoconversion']) ? $settings['autoconversion'] : '',
    '#weight' => 17,
  );
  $thumb_options = array(
    'auto' => 'Automatically generate thumbnails',
    'auto_fallback' => 'Automatically generate thumbnails, with fallback to manual upload if fail',
    'manual_upload' => 'Manually upload a thumbnail',
    'no' => 'Don\'t create thumbnail',
  );
  $form['autothumbnail'] = array(
    '#type' => 'radios',
    '#title' => t('Thumbnail Generation'),
    '#options' => $thumb_options,
    '#description' => t('To use ffmpeg(Default) to create thumbnails, Please make sure to configure your transcoder settings before using ffmpeg to create thumbnails.'),
    '#default_value' => isset($settings['autothumbnail']) ? $settings['autothumbnail'] : 'no',
    '#weight' => 18,
  );
  $form['default_video_thumbnail'] = array(
    '#title' => t('Default video thumbnail'),
    '#type' => 'managed_file',
    '#element_validate' => array(
      'video_field_default_thumbnail_validate',
    ),
    '#description' => t('If use default thumbnanil is selected, this image will be shown on display.'),
    '#default_value' => !empty($settings['default_video_thumbnail']['fid']) ? $settings['default_video_thumbnail']['fid'] : '',
    '#upload_location' => 'public://videos/thumbnails/default',
    '#weight' => 19,
  );
  $form['preview_video_thumb_style'] = array(
    '#title' => t('Preview thumbnail style'),
    '#type' => 'select',
    '#options' => image_style_options(FALSE),
    '#empty_option' => '<' . t('no preview') . '>',
    '#default_value' => !empty($settings['preview_video_thumb_style']) ? $settings['preview_video_thumb_style'] : '',
    '#description' => t('The preview image will be shown while editing the content.'),
    '#weight' => 20,
  );
  return $form;
}