Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if ($this->bag->has('video')) {
         $video = $this->bag->get('video');
         if (!($videoPath = parse_url($video, PHP_URL_PATH)) || !($type = pathinfo($videoPath, PATHINFO_EXTENSION))) {
             $type = $this->bag->get('video:type');
         }
         switch ($type) {
             case 'swf':
             case 'application/x-shockwave-flash':
                 return Utils::flash($video, $this->getWidth(), $this->getHeight());
             case 'mp4':
             case 'ogg':
             case 'ogv':
             case 'webm':
             case 'application/mp4':
             case 'video/mp4':
             case 'video/ogg':
             case 'video/ogv':
             case 'video/webm':
                 $images = $this->getImagesUrls();
                 return Utils::videoHtml(current($images), $video, $this->getWidth(), $this->getHeight());
         }
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if ($this->bag->has('video_src')) {
         switch ($this->bag->get('video_type')) {
             case 'application/x-shockwave-flash':
                 return Utils::flash($this->bag->get('video_src'), $this->getWidth(), $this->getHeight());
         }
     }
 }