You are here

public function GameTrailers::flash in Video Filter 8

Flash video (flv)

Overrides VideoFilterBase::flash

File

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

Class

GameTrailers
Provides GameTrailers codec for Video Filter.

Namespace

Drupal\video_filter\Plugin\VideoFilter

Code

public function flash($video) {
  if (is_numeric($video['codec']['matches'][1])) {
    $match = $video['codec']['matches'][1];
  }
  elseif (is_numeric($video['codec']['matches'][2])) {
    $match = $video['codec']['matches'][2];
  }
  return [
    'src' => '//media.mtvnservices.com/embed/mgid:moses:video:gametrailers.com:' . $match,
  ];
}