function video_ffmpeg_helper_admin_settings_validate in Video 6.2
Same name and namespace in other branches
- 5 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_admin_settings_validate()
- 6 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_admin_settings_validate()
Validation for settings form
File
- plugins/
video_ffmpeg_helper/ video_ffmpeg_helper.module, line 69 - Provide some api for use ffmpeg. Simplify video nodes creation.
Code
function video_ffmpeg_helper_admin_settings_validate($form, &$form_state) {
if (variable_get('video_image_auto_thumbnail', 0)) {
if (!_video_ffmpeg_helper_check_exe_path($form_state['values']['video_ffmpeg_helper_ffmpeg_path'])) {
form_set_error('video_ffmpeg_helper_ffmpeg_path', t('Set correct path for ffmpeg'));
}
if (!is_numeric($form_state['values']['video_ffmpeg_helper_auto_thumbnail_seek'])) {
form_set_error('video_ffmpeg_helper_auto_thumbnail_seek', t('Seek time must be an integer'));
}
$options = $form_state['values']['video_ffmpeg_helper_thumbnailer_options'];
if (!strstr($options, '%videofile') || !strstr($options, '%thumbfile')) {
form_set_error('video_ffmpeg_helper_thumbnailer_options', t('Thumbnail options must contain mandatory arguments %videofile and %thumbfile'));
}
}
}