MailRu.php in Video Filter 8
File
src/Plugin/VideoFilter/MailRu.php
View source
<?php
namespace Drupal\video_filter\Plugin\VideoFilter;
use Drupal\video_filter\VideoFilterBase;
class MailRu extends VideoFilterBase {
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',
],
];
}
public function options() {
$form = parent::options();
$form['autoplay'] = [
'#title' => $this
->t('Autoplay'),
'#type' => 'checkbox',
];
return $form;
}
}
Classes
Name |
Description |
MailRu |
Provides MailRu codec for Video Filter. |