You are here

public function Youtube::options in Video Filter 8

Embed options. (e.g. Autoplay, Width/Height).

Uses Drupal's Form API.

Overrides VideoFilterBase::options

File

src/Plugin/VideoFilter/Youtube.php, line 89

Class

Youtube
Provides Youtube codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function options() {
  $form = parent::options();
  $form['autoplay'] = [
    '#title' => $this
      ->t('Autoplay'),
    '#type' => 'checkbox',
  ];
  $form['related'] = [
    '#title' => $this
      ->t('Show related videos'),
    '#type' => 'checkbox',
  ];
  $form['loop'] = [
    '#title' => $this
      ->t('Loop'),
    '#type' => 'checkbox',
  ];
  $form['autohide'] = [
    '#title' => $this
      ->t('Autohide'),
    '#type' => 'checkbox',
  ];
  $form['showinfo'] = [
    '#title' => $this
      ->t('Show info'),
    '#type' => 'checkbox',
  ];
  $form['modestbranding'] = [
    '#title' => $this
      ->t('Modest branding'),
    '#type' => 'checkbox',
  ];
  $form['enablejsapi'] = [
    '#title' => $this
      ->t('Enable control via IFrame or JavaScript Player API calls.'),
    '#type' => 'checkbox',
  ];
  $form['start'] = [
    '#title' => $this
      ->t('Start time (optional)'),
    '#type' => 'textfield',
    '#description' => $this
      ->t('Example: <strong>2m3s</strong> or <strong>15s</strong>.'),
    '#attributes' => [
      'placeholder' => '2m3s',
    ],
  ];
  $form['theme'] = [
    '#title' => $this
      ->t('Theme'),
    '#type' => 'select',
    '#options' => [
      'dark' => $this
        ->t('Dark'),
      'light' => $this
        ->t('Light'),
    ],
    '#description' => $this
      ->t('Setting the color parameter to white will disable the modestbranding option.'),
  ];
  $form['color'] = [
    '#title' => $this
      ->t('Color'),
    '#type' => 'select',
    '#options' => [
      'red' => $this
        ->t('Red'),
      'white' => $this
        ->t('White'),
    ],
    '#description' => $this
      ->t('Setting the color parameter to white will disable the modestbranding option.'),
  ];
  return $form;
}