function brightcove_media_upload_form in Brightcove Video Connect 7.7
Same name and namespace in other branches
- 7.2 brightcove_media/brightcove_media.module \brightcove_media_upload_form()
- 7.3 brightcove_media/brightcove_media.module \brightcove_media_upload_form()
- 7.4 brightcove_media/brightcove_media.module \brightcove_media_upload_form()
- 7.6 brightcove_media/brightcove_media.module \brightcove_media_upload_form()
Upload form for brightcove media.
1 string reference to 'brightcove_media_upload_form'
- MediaBrowserBrightcoveVideo::view in brightcove_media/
includes/ MediaBrowserBrightcoveVideo.inc
File
- brightcove_media/
brightcove_media.module, line 408 - This module provide the hook implementations for the integration with Media module.
Code
function brightcove_media_upload_form($form, &$form_state) {
module_load_include('video.inc', 'brightcove');
$form['uploadform'] = [
'#type' => 'fieldset',
'#title' => t('Upload video'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t('It takes several minutes (depending on processing time in Brightcove cloud), until video is available after upload. Clicking \'Upload and attach\' uploads video to Brightcove then closes the dialog and attaches the video.'),
];
$client = brightcove_client_load_or_default();
$form['uploadform'] += _brightcove_upload_form($form_state, entity_create('brightcove_video', [
'type' => 'brightcove_video',
'account_id' => $client->account_id,
'client' => $client,
]));
$form['uploadform']['submit'] = [
'#type' => 'button',
'#name' => 'upload',
'#value' => t('Upload and attach'),
'#ajax' => [
'callback' => 'ajax_brightcove_media_upload_callback',
'wrapper' => 'bc-upload-form',
],
];
$form['#prefix'] = '<div id="bc-upload-form">';
$form['#suffix'] = '</div>';
return $form;
}