저자: XE Developers (developers@xpressengine.com)
상속: extends Xpressengine\Storage\File, use trait Xpressengine\Media\MimeTypeFilter
예제 #1
0
 /**
  * 미디어에서 사진 추출
  *
  * @param Media $media image instance
  * @return string 이미지 content
  * @throws WrongInstanceException
  */
 public function getPicture(Media $media)
 {
     if (!$media instanceof Image) {
         throw new WrongInstanceException();
     }
     return $media->getContent();
 }
예제 #2
0
 /**
  * 동적으로 생성된 미디어 파일 반환
  *
  * @param Media $media media instance
  * @return Collection|Media[]
  */
 public function getDerives(Media $media)
 {
     $files = $media->getRawDerives();
     foreach ($files as $key => $file) {
         $files[$key] = $this->is($file) ? $this->make($file) : null;
     }
     return $files->filter();
 }
예제 #3
0
 /**
  * 미디어에서 사진 추출
  *
  * @param Media $media media instance
  * @return null|string 이미지 content
  * @throws WrongInstanceException
  */
 public function getPicture(Media $media)
 {
     if (!$media instanceof Video) {
         throw new WrongInstanceException();
     }
     $snapshot = $this->extension->getSnapshot($media->getContent(), $this->fromSecond);
     return $snapshot;
 }