You are here

public function AmpFormTrait::autoplayElement in Accelerated Mobile Pages (AMP) 8.3

The autoplay form element.

Return value

array A form element.

3 calls to AmpFormTrait::autoplayElement()
AmpImageCarousel::settingsForm in src/Plugin/Field/FieldFormatter/AmpImageCarousel.php
Returns a form to configure settings for the formatter.
AmpVideoFormatter::settingsForm in src/Plugin/Field/FieldFormatter/AmpVideoFormatter.php
Returns a form to configure settings for the formatter.
AmpViewsCarouselStyle::buildOptionsForm in src/Plugin/views/style/AmpViewsCarouselStyle.php
Provide a form to edit options for this plugin.

File

src/AmpFormTrait.php, line 259

Class

AmpFormTrait
AMP Form trait.

Namespace

Drupal\amp

Code

public function autoplayElement() {
  $element = [
    '#title' => $this
      ->t('Autoplay'),
    '#type' => 'checkbox',
    '#description' => $this
      ->t('Autoplay the videos for users without the "never autoplay videos" permission. Roles with this permission will bypass this setting.'),
    '#default_value' => $this
      ->getSetting('autoplay'),
  ];
  return $element;
}