You are here

function minplayer_player_settings_form in MediaFront 7.2

Same name and namespace in other branches
  1. 7 players/minplayer/minplayer.module \minplayer_player_settings_form()

Implements hook_player_settings_form

File

players/minplayer/minplayer.module, line 152

Code

function minplayer_player_settings_form($preset) {

  /********************* PRESENTATION SETTINGS ***************************/
  $form = array();
  $form['presentation'] = array(
    '#type' => 'fieldset',
    '#title' => t('Presentation Settings'),
    '#weight' => -10,
    '#collapsible' => true,
    '#collapsed' => true,
  );
  $form['presentation']['template'] = array(
    '#type' => 'select',
    '#title' => t('Template'),
    '#description' => t('Select the template you would like to use for this player.  The template provides specific functionality as well as the layout for the media player.  Each template can be found in the <strong>modules/mediafront/players/osmplayer/player/templates</strong> folder.'),
    '#options' => minplayer_get_templates(),
    '#default_value' => $preset['settings']['template'],
  );
  $form['presentation']['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Player Width'),
    '#description' => t('Enter the width of the player in pixels or percentage.'),
    '#default_value' => $preset['settings']['width'],
  );
  $form['presentation']['height'] = array(
    '#type' => 'textfield',
    '#title' => t('Player Height'),
    '#description' => t('Enter the height of the player.'),
    '#default_value' => $preset['settings']['height'],
  );
  $form['presentation']['showWhenEmpty'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show player when empty'),
    '#description' => t('Check if you would like to show the player even if there is nothing to play'),
    '#default_value' => $preset['settings']['showWhenEmpty'],
  );
  $form['presentation']['wmode'] = array(
    '#title' => t('Flash Window Mode'),
    '#type' => 'select',
    '#options' => array(
      'none' => 'none',
      'transparent' => 'transparent',
      'window' => 'window',
    ),
    '#default_value' => $preset['settings']['wmode'],
    '#description' => t('Selects which window mode you would like for the OSM Flash player to operate under (denoted by the <b>wmode</b> parameter in the object code)
         <ul>
            <li><b>none</b> - <em>No window mode</em></li>
            <li><b>wmode=transparent</b> - <em>Allows for other elements to drop in front of the video (like a drop-down list), without the video showing over those elements.</em></li>
            <li><b>wmode=window</b> - <em>Allows for the video to have full-screen support.</em></li>
         </ul>'),
  );

  /********************* MEDIA SETTINGS ***************************/
  $form['media_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Media Settings'),
    '#weight' => -9,
    '#collapsible' => true,
    '#collapsed' => true,
  );
  $form['media_settings']['volume'] = array(
    '#type' => 'textfield',
    '#title' => t('Default Volume'),
    '#description' => t('Enter the initial volume for the player.'),
    '#default_value' => $preset['settings']['volume'],
  );
  $form['media_settings']['preload'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto Load'),
    '#description' => t('If checked, the media will automatically start loading once the page loads.'),
    '#default_value' => !empty($preset['settings']['preload']),
  );
  $form['media_settings']['loop'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto Repeat'),
    '#description' => t('If checked, the media will play repeatidly.'),
    '#default_value' => !empty($preset['settings']['loop']),
  );
  $form['media_settings']['autoplay'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto Start'),
    '#description' => t('If checked, the media will automatically load and play once the page loads.'),
    '#default_value' => !empty($preset['settings']['autoplay']),
  );
  $form['misc'] = array(
    '#type' => 'fieldset',
    '#title' => t('Other Settings'),
    '#weight' => -3,
    '#collapsible' => true,
    '#collapsed' => true,
  );
  $form['misc']['debug'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Player Debugging'),
    '#description' => t('Select if you would like to see the debug statements from the Media Player.'),
    '#default_value' => $preset['settings']['debug'],
  );
  return $form;
}