public function getPreviewVideoAction() { $asset = Asset::getById($this->_getParam("id")); $this->view->asset = $asset; $config = new Asset_Video_Thumbnail_Config(); $config->setName("pimcore_video_preview_" . $asset->getId()); $config->setAudioBitrate(128); $config->setVideoBitrate(700); $config->setItems(array(array("method" => "scaleByWidth", "arguments" => array("width" => 500)))); $thumbnail = $asset->getThumbnail($config, array("mp4")); if ($thumbnail) { $this->view->asset = $asset; $this->view->thumbnail = $thumbnail; if ($thumbnail["status"] == "finished") { $this->render("get-preview-video-display"); } else { $this->render("get-preview-video-error"); } } else { $this->render("get-preview-video-error"); } }
public function videoThumbnailAddAction() { $alreadyExist = false; try { Asset_Video_Thumbnail_Config::getByName($this->_getParam("name")); $alreadyExist = true; } catch (Exception $e) { $alreadyExist = false; } if (!$alreadyExist) { $pipe = new Asset_Video_Thumbnail_Config(); $pipe->setName($this->_getParam("name")); $pipe->save(); } $this->_helper->json(array("success" => !$alreadyExist)); }