You are here

public function MailRu::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

src/Plugin/VideoFilter/MailRu.php, line 25

Class

MailRu
Provides MailRu codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  $attributes = [
    'autoplay' => !empty($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : '',
  ];
  return [
    'src' => '//videoapi.my.mail.ru/videos/embed/v/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.html?' . implode('&', $attributes),
    'properties' => [
      'allowfullscreen' => 'true',
      'webkitallowfullscreen' => 'true',
      'mozallowfullscreen' => 'true',
    ],
  ];
}