You are here

public function DailyMotion::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

src/Plugin/VideoFilter/DailyMotion.php, line 26

Class

DailyMotion
Provides DailyMotion codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  $attributes = [
    'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
  ];
  return [
    'src' => '//www.dailymotion.com/embed/video/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes),
  ];
}