You are here

public function Ustream::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

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

Class

Ustream
Provides Ustream codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  $attributes = [
    'html5ui' => 'html5ui',
    'autoplay' => isset($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : 'autoplay=0',
  ];
  return [
    'src' => '//www.ustream.tv/embed/recorded/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes),
    'properties' => [
      'allowfullscreen' => 'true',
      'webkitallowfullscreen' => 'true',
    ],
  ];
}