Beispiel #1
0
 /**
  * @param string $pageTitle
  * @param array|null $transformParams
  * @return string|null - html of thumbnail with play button
  */
 public function getThumbnailHtmlFromFileTitle($pageTitle, $transformParams = null)
 {
     $file = null;
     try {
         $title = \Title::newFromText($pageTitle, NS_FILE);
         $transformParams['width'] = isset($transformParams['width']) ? $transformParams['width'] : static::THUMB_DEFAULT_WIDTH;
         $transformParams['height'] = isset($transformParams['height']) ? $transformParams['height'] : static::THUMB_DEFAULT_HEIGHT;
         return \WikiaFileHelper::getVideoThumbnailHtml($title, $transformParams['width'], $transformParams['height'], false);
     } catch (\Exception $ex) {
         // we have some issues on dev box (no starter database).
         // swallow the exception for now. Should we log this event ?
         return '';
     }
 }