コード例 #1
0
 /**
  * 미디어에서 사진 추출
  *
  * @param Media $media media instance
  * @return null|string 이미지 content
  * @throws InstanceNotMatchException
  */
 public function getPicture(Media $media)
 {
     if (!$media instanceof Video) {
         throw new InstanceNotMatchException();
     }
     // todo: 추출할 시간 정보를 별도로 입력받도록 처리할지?
     $snapshot = $this->extension->getSnapshot($this->storage->read($media->getFile()));
     return $snapshot;
 }
コード例 #2
0
 /**
  * 미디어에서 사진 추출
  *
  * @param Media $media image instance
  * @return string 이미지 content
  * @throws InstanceNotMatchException
  */
 public function getPicture(Media $media)
 {
     if (!$media instanceof Image) {
         throw new InstanceNotMatchException();
     }
     return $this->storage->read($media->getFile());
 }