Brightcove.php in Video Filter 8
File
src/Plugin/VideoFilter/Brightcove.php
View source
<?php
namespace Drupal\video_filter\Plugin\VideoFilter;
use Drupal\video_filter\VideoFilterBase;
class Brightcove extends VideoFilterBase {
public function html($video) {
$html = '';
$video_url = !empty($video['codec']['matches'][0]) ? $video['codec']['matches'][0] : '';
if (!empty($video_url)) {
$html .= '<div style="display: block; position: relative; max-width: 500px;">';
$html .= '<div style="padding-top: 56.25%;">';
$html .= '<iframe frameborder="0" src="' . $video_url . '"';
$html .= ' allowfullscreen webkitallowfullscreen mozallowfullscreen';
$html .= ' style="width: 100%; height: 100%; position: absolute;';
$html .= ' top: 0px; bottom: 0px; right: 0px; left: 0px;"></iframe>';
$html .= '</div></div>';
}
return $html;
}
}
Classes
Name |
Description |
Brightcove |
Provides Brightcove codec for Video Filter. |