/** * 미디어에서 사진 추출 * * @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; }
/** * 미디어에서 사진 추출 * * @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; }