public function __construct($oembed) { parent::__construct(); $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addCodeParam($oembed["html"]); if (!empty($oembed["thumbnail_url"])) { $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addAutoPlay($oembed["html"]); } $this->assign('oembed', $oembed); }
public function __construct($oembed, $expandedView = false) { parent::__construct(); $this->uniqId = uniqid('eqattachment'); $this->assign('uniqId', $this->uniqId); $types = array('video', 'photo', 'link'); $type = in_array($oembed['type'], $types) ? $oembed['type'] : 'link'; if ($type == "video") { $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addCodeParam($oembed["html"]); if (!empty($oembed["thumbnail_url"])) { $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addAutoPlay($oembed["html"]); } } $this->oembed = $oembed; $plugin = OW::getPluginManager()->getPlugin('equestions'); $this->setTemplate($plugin->getCmpViewDir() . 'att_' . $type . '.html'); $this->assign('expandedView', $expandedView); }
public function videoPreview($query) { $query['oembed']['html'] = EQUESTIONS_CLASS_VideoTools::validateEmbedCode($query['oembed']['html']); if (empty($query['oembed']['html'])) { return array("error" => 'Not valid video embed'); } $cmp = new EQUESTIONS_CMP_AttVideoPreview($query['oembed']); $markup = array('html' => $cmp->render(), 'js' => OW::getDocument()->getOnloadScript(), 'css' => ''); return array("oembed" => $query['oembed'], "content" => $markup); }