} </style> </head> <body> <table id="wrapper" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td class="error" align="center" valign="center"> <?php if ($this->thumbnail && $this->thumbnail["status"] == "inprogress") { ?> <?php $progress = Asset_Video_Thumbnail_Processor::getProgress($this->thumbnail["processId"]); ?> <style type="text/css"> .pimcore_tag_video_progress { position:relative; background:#555 url(<?php echo $this->asset->getImageThumbnail(array("width" => 640)); ?> ) no-repeat center center; font-family:Arial,Verdana,sans-serif; color:#fff; text-shadow: 0 0 3px #000, 0 0 5px #000, 0 0 1px #000; } .pimcore_tag_video_progress_status { font-size:16px;
public function getAssetCode() { $asset = Asset::getById($this->id); $options = $this->getOptions(); if ($asset && $options["thumbnail"]) { $thumbnail = $asset->getThumbnail($options["thumbnail"]); if ($thumbnail) { $image = $asset->getImageThumbnail(array("width" => $this->getWidth(), "height" => $this->getHeight())); if ($thumbnail["status"] == "finished") { return $this->getFlowplayerCode($thumbnail["formats"], $image); } else { if ($thumbnail["status"] == "inprogress") { // disable the output-cache if enabled $front = Zend_Controller_Front::getInstance(); $front->unregisterPlugin("Pimcore_Controller_Plugin_Cache"); $progress = Asset_Video_Thumbnail_Processor::getProgress($thumbnail["processId"]); return $this->getProgressCode($progress, $image); } } } } return $this->getFlowplayerCode((string) $asset); }
public function getAssetCode() { $asset = Asset::getById($this->id); // compatibility mode when FFMPEG is not present if (!Pimcore_Video::isAvailable()) { // try to load the assigned asset into the flowplayer return $this->getFlowplayerCode(array("mp4" => (string) $asset)); } $options = $this->getOptions(); if ($asset instanceof Asset_Video && $options["thumbnail"]) { $thumbnail = $asset->getThumbnail($options["thumbnail"]); if ($thumbnail) { // try to get the dimensions out ouf the video thumbnail $imageThumbnailConf = array(); $thumbnailConf = $asset->getThumbnailConfig($options["thumbnail"]); $transformations = $thumbnailConf->getItems(); if (is_array($transformations) && count($transformations) > 0) { foreach ($transformations as $transformation) { if (!empty($transformation)) { if (is_array($transformation["arguments"])) { foreach ($transformation["arguments"] as $key => $value) { if ($key == "width" || $key == "height") { $imageThumbnailConf[$key] = $value; } } } } } } if (empty($imageThumbnailConf)) { $imageThumbnailConf["width"] = 800; } $image = $asset->getImageThumbnail($imageThumbnailConf); if ($thumbnail["status"] == "finished") { if ($options["html5"]) { return $this->getHtml5Code($thumbnail["formats"], $image); } else { return $this->getFlowplayerCode($thumbnail["formats"], $image); } } else { if ($thumbnail["status"] == "inprogress") { // disable the output-cache if enabled $front = Zend_Controller_Front::getInstance(); $front->unregisterPlugin("Pimcore_Controller_Plugin_Cache"); $progress = Asset_Video_Thumbnail_Processor::getProgress($thumbnail["processId"]); return $this->getProgressCode($progress, $image); } else { return $this->getErrorCode("The video conversion failed, please see the debug.log for more details."); } } } else { return $this->getErrorCode("The given thumbnail doesn't exist"); } } else { // try to load the assigned asset into the flowplayer (backward compatibility only for f4v, flv, and mp4 files) if ($asset instanceof Asset && preg_match("/\\.(f4v|flv|mp4)/", $asset->getFullPath())) { // try to generate thumbnail with ffmpeg if installed if (Pimcore_Video::isAvailable()) { $image = $asset->getImageThumbnail(array("width" => array_key_exists("width", $options) ? $options["width"] : 800)); } return $this->getFlowplayerCode(array("mp4" => (string) $asset), $image); } return $this->getErrorCode("Asset is not a video, or missing thumbnail configuration"); } }