You are here

public function Whatchado::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

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

Class

Whatchado
Provides Whatchado codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  if (!empty($video['codec']['matches'][3])) {
    $video_url = 'https://www.whatchado.com/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '/embed/' . $video['codec']['matches'][3];
  }
  else {
    $video_url = 'https://www.whatchado.com/' . $video['codec']['matches'][1] . '/stories/embed/' . $video['codec']['matches'][2];
  }
  return [
    'src' => $video_url,
    'properties' => [
      'allowfullscreen' => 'true',
    ],
  ];
}