You are here

public function DemocracyNow::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

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

Class

DemocracyNow
Provides DemocracyNow codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  if (!empty($video['codec']['matches'][4])) {
    $embed_url = 'http://www.democracynow.org/embed/story/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '/' . $video['codec']['matches'][3] . '/' . $video['codec']['matches'][4];
  }
  else {
    $embed_url = 'http://www.democracynow.org/embed/show/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '/' . $video['codec']['matches'][3];
  }
  return [
    'src' => $embed_url,
    'properties' => [
      'allowfullscreen' => 'true',
    ],
  ];
}