You are here

public function MediaThumbnailsVideoSettingsForm::buildForm in Media Thumbnails Video 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/MediaThumbnailsVideoSettingsForm.php, line 30

Class

MediaThumbnailsVideoSettingsForm
Configure MediaThumbnailsVideoSettingsForm.

Namespace

Drupal\media_thumbnails_video\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['ffmpeg'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('FFmpeg binary path'),
    '#default_value' => $this
      ->config('media_thumbnails_video.settings')
      ->get('ffmpeg'),
  ];
  $form['ffprobe'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('FFprobe binary path'),
    '#default_value' => $this
      ->config('media_thumbnails_video.settings')
      ->get('ffprobe'),
  ];
  $form['timeout'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Timeout'),
    '#default_value' => $this
      ->config('media_thumbnails_video.settings')
      ->get('timeout'),
    '#min' => 100,
    '#step' => 100,
  ];
  $form['threads'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Threads'),
    '#default_value' => $this
      ->config('media_thumbnails_video.settings')
      ->get('threads'),
    '#min' => 1,
  ];
  return parent::buildForm($form, $form_state);
}