/** * {@inheritdoc} */ public function getCode() { if ($code = parent::getcode()) { return $code; } switch (self::$contentTypes[$this->request->getMimeType()][1]) { case 'videoHtml': return Utils::videoHtml($this->image, $this->url, $this->imageWidth, $this->imageHeight); case 'audioHtml': return Utils::audioHtml($this->url); case 'google': return Utils::google($this->url); } }
public function setFromEmbed(\Embed\Adapters\Adapter $info) { $this->Title = $info->getTitle(); $this->SourceURL = $info->getUrl(); $this->Width = $info->getWidth(); $this->Height = $info->getHeight(); $this->ThumbURL = $info->getImage(); $this->Description = $info->getDescription() ? $info->getDescription() : $info->getTitle(); $this->Type = $info->getType(); $embed = $info->getCode(); $this->EmbedHTML = $embed ? $embed : $this->EmbedHTML; }