You are here

public function Twitch::iframe in Video Filter 8

HTML5 video (iframe).

Overrides VideoFilterBase::iframe

File

src/Plugin/VideoFilter/Twitch.php, line 27

Class

Twitch
Provides Twitch codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function iframe($video) {
  $attributes = [
    'autoplay' => !empty($video['autoplay']) ? 'autoplay=1' : 'autoplay=0',
    'time' => !empty($video['time']) ? 'time=' . $video['time'] : '',
  ];
  return [
    'src' => '//player.twitch.tv/?channel=' . $video['codec']['matches'][1],
    'parameters' => [
      'scrolling' => 'no',
    ],
  ];
}