private function getProperties(UploadedFile $uploadedFile)
{
$mimeType = $uploadedFile->getMimeType();
$properties = [];
try {
// if the file is a video we add the duration
if (fnmatch('video/*', $mimeType)) {
$properties['duration'] = $this->ffprobe->format($uploadedFile->getPathname())->get('duration');
}
} catch (ExecutableNotFoundException $e) {
// Exception is thrown if ffmpeg is not installed -> duration is not set
}
return $properties;
}