function video_embed_field_handler_youtube_form in Video Embed Field 7
Same name and namespace in other branches
- 7.2 video_embed_field.handlers.inc \video_embed_field_handler_youtube_form()
Defines the form elements for the youtube configuration form Eventually it might be nice to have these forms be available per instance instead of just global config
1 string reference to 'video_embed_field_handler_youtube_form'
- video_embed_field_video_embed_handler_info in ./
video_embed_field.module - Implementation of hook_video_embed_handler_info
File
- ./
video_embed_field.module, line 480
Code
function video_embed_field_handler_youtube_form($defaults) {
$form = array();
$form['height'] = array(
'#type' => 'textfield',
'#size' => '5',
'#title' => t('Player Height'),
'#description' => t('The height of the youtube player, in pixels. Only enter the number e.g. 349'),
'#default_value' => $defaults['height'],
);
$form['width'] = array(
'#type' => 'textfield',
'#size' => '5',
'#title' => t('Player Width'),
'#description' => t('The width of the youtube player, in pixels. Only enter the number e.g. 560'),
'#default_value' => $defaults['width'],
);
$form['teaser_height'] = array(
'#type' => 'textfield',
'#size' => '5',
'#title' => t('Player Height - Teaser'),
'#description' => t('The height of the youtube player, in pixels. Only enter the number e.g. 349'),
'#default_value' => $defaults['teaser_height'],
);
$form['teaser_width'] = array(
'#type' => 'textfield',
'#size' => '5',
'#title' => t('Player Width - Teaser'),
'#description' => t('The width of the youtube player, in pixels. Only enter the number e.g. 560'),
'#default_value' => $defaults['teaser_width'],
);
$form['theme'] = array(
'#type' => 'select',
'#options' => array(
'dark' => t('Dark'),
'light' => t('Light'),
),
'#title' => t('Player theme'),
'#default_value' => $defaults['theme'],
);
$form['autoplay'] = array(
'#type' => 'checkbox',
'#title' => t('Autoplay'),
'#description' => t('Play the video immediately.'),
'#default_value' => $defaults['autoplay'],
);
$form['hd'] = array(
'#type' => 'checkbox',
'#title' => t('Use HD'),
'#description' => t('Attempt to play the video in HD if available.'),
'#default_value' => $defaults['hd'],
);
$form['rel'] = array(
'#type' => 'checkbox',
'#title' => t('Show related videos'),
'#description' => t('Show related videos after the video is finished playing.'),
'#default_value' => $defaults['rel'],
);
$form['showinfo'] = array(
'#type' => 'checkbox',
'#title' => t('Show info'),
'#description' => t('Display information like the video title and rating before the video starts playing.'),
'#default_value' => $defaults['showinfo'],
);
$form['autohide'] = array(
'#type' => 'radios',
'#options' => array(
0 => t('The video progress bar and player controls will be visible throughout the video.'),
1 => t('Automatically slide the video progress bar and the player controls out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a keyboard key.'),
2 => t('The video progress bar will fade out but the player controls (play button, volume control, etc.) remain visible.'),
),
'#title' => t('Autohide progress bar and the player controls'),
'#description' => t('Controls the autohide behavior of the youtube player controls.'),
'#default_value' => $defaults['autohide'],
);
return $form;
}