Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }