You are here

function videojs_settings_form in Video.js (HTML5 Video Player) 6

Same name and namespace in other branches
  1. 6.2 includes/videojs.admin.inc \videojs_settings_form()
  2. 7.3 includes/videojs.admin.inc \videojs_settings_form()
  3. 7 includes/videojs.admin.inc \videojs_settings_form()
  4. 7.2 includes/videojs.admin.inc \videojs_settings_form()

Menu callback; Provides the Video.js settings form.

1 string reference to 'videojs_settings_form'
videojs_menu in ./videojs.module
Implementation of hook_menu().

File

includes/videojs.admin.inc, line 10
Administrative pages for the Video.js module.

Code

function videojs_settings_form() {
  $form = array();
  $form['videojs_directory'] = array(
    '#type' => 'textfield',
    '#title' => t('Video.js file directory'),
    '#default_value' => variable_get('videojs_directory', 'sites/all/libraries/video-js'),
    '#description' => t('Specify the path that contains the Video.js library. The video.js file should be in the root of this directory.'),
  );
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video.js options'),
    '#collapsible' => FALSE,
  );
  $form['options']['videojs_autoplay'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto-play files on page load'),
    '#description' => t('Use caution when combining this option with multiple players on the same page.'),
    '#default_value' => variable_get('videojs_autoplay', FALSE),
  );
  $form['options']['videojs_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Player width'),
    '#default_value' => variable_get('videojs_width', 640),
  );
  $form['options']['videojs_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Player height'),
    '#default_value' => variable_get('videojs_height', 264),
  );
  $options = array(
    0 => 'Default',
    'tube-css' => 'Youtube',
    'vim-css' => 'Vimeo',
    'hu-css' => 'Hulu',
  );
  $form['options']['videojs_skin'] = array(
    '#type' => 'select',
    '#title' => t('Player skin'),
    '#options' => $options,
    '#default_value' => variable_get('videojs_skin', 'default'),
  );
  $form['thumbnails'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video.js thumbnails'),
    '#collapsible' => FALSE,
    '#description' => t('Thumbnail settings for Video.js widget'),
  );
  foreach (_videojs_settings_thumbnail_fields() as $node_type => $value) {
    $form['thumbnails']['videojs_' . $node_type] = array(
      '#type' => 'select',
      '#title' => t('@fieldname in @contenttype', array(
        '@fieldname' => $value['video_js_field'],
        '@contenttype' => $value['description'],
      )),
      '#default_value' => variable_get('videojs_' . $node_type, module_exists('video') ? 'video_module' : $value['filefields'][0]),
      '#options' => module_exists('video') ? array(
        'video_module' => t('Video module'),
      ) + $value['filefields'] : $value['filefields'],
    );
  }
  $form['flash'] = array(
    '#type' => 'fieldset',
    '#title' => t('Flowplayer fallback'),
    '#collapsible' => FALSE,
  );
  $form['flash']['videojs_flowplayer_extraplayerheight'] = array(
    '#type' => 'textfield',
    '#title' => t('Add vertical space to accommodate the Flowplayer control bar'),
    '#field_suffix' => 'pixels',
    '#default_value' => variable_get('videojs_flowplayer_extraplayerheight', 24),
    '#description' => t('The control bar in Flowplayer 3.2 and up uses an overlay on top of the video, so the player size is equal to the video size. For custom control bars or older Flowplayer versions you can use this field to add vertical space to the player height.'),
    '#size' => 5,
    '#maxlength' => 3,
  );
  $form['flash']['videojs_wmode'] = array(
    '#type' => 'select',
    '#title' => t('Flash wmode'),
    '#description' => t('Allows you to enable and select wmode.'),
    '#default_value' => variable_get('videojs_wmode', ''),
    '#options' => array(
      '' => t('None'),
      'window' => 'Window',
      'transparent' => 'Transparent',
      'opaque' => 'Opaque',
    ),
  );
  $form = system_settings_form($form);
  $form['#validate'][] = 'videojs_settings_form_validate';
  $form['#submit'][] = 'videojs_settings_form_submit';
  return $form;
}