public function getHTMLContent()
{
if (!self::supportVideoJS($this->video_service)) {
- return self::getEmbed($this);
+ return self::getEmbed($this, $this->compiler, null, null);
}
$w = round($this->width * $this->getCssScale());
return self::makeVideoTag($this, $w, $h, $this->compiler);
}
- public static function getEmbed($link, $width = null, $height = null)
+ public static function getEmbed($link, $compiler = null, $width = null, $height = null)
{
if (null === $width) {
$width = $link->width;
if (null === $height) {
$height = $link->height;
}
- return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen allow="autoplay; fullscreen"></iframe>';
+ return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link, $compiler) . '" frameborder="0" allowfullscreen allow="autoplay; fullscreen"></iframe>';
}
- public static function getEmbedURL($data)
+ public static function getEmbedURL($data, $compiler)
{
$muted = (!$data->video_sound_on) ? '1' : '0';
$autoplay = $data->video_auto_start ? '1' : '0';
}
return $url;
default:
- return $data->to;
+ return $compiler->shortenURL($data->to);
}
}
if (self::supportVideoJS($link->video_service)) {
return parent::makeVideoTag($link, $width, $height, $compiler);
}
- return self::getEmbed($link);
+ return self::getEmbed($link, $compiler);
}
protected static function supportVideoJS($service)