rm some dead code

This commit is contained in:
Shish 2019-06-14 13:52:27 +01:00
parent 064b24ffc1
commit 44fcc3a1e9

View File

@ -55,16 +55,7 @@ class VideoFileHandler extends DataHandlerExtension
*/ */
protected function create_thumb(string $hash): bool protected function create_thumb(string $hash): bool
{ {
$ok = false; return create_thumbnail_ffmpeg($hash);
$ok = create_thumbnail_ffmpeg($hash);
return $ok;
}
protected function video_size(string $filename): array
{
return video_size($filename);
} }
protected function supported_ext(string $ext): bool protected function supported_ext(string $ext): bool
@ -77,8 +68,7 @@ class VideoFileHandler extends DataHandlerExtension
{ {
$image = new Image(); $image = new Image();
//NOTE: No need to set width/height as we don't use it. $size = video_size($filename);
$size = $this->video_size($filename);
$image->width = $size[0]; $image->width = $size[0];
$image->height = $size[1]; $image->height = $size[1];
@ -111,19 +101,15 @@ class VideoFileHandler extends DataHandlerExtension
protected function check_contents(string $tmpname): bool protected function check_contents(string $tmpname): bool
{ {
$success = false; return (
if (file_exists($tmpname)) { file_exists($tmpname) &&
$mimeType = getMimeType($tmpname); in_array(getMimeType($tmpname), [
$success = in_array($mimeType, [
'video/webm', 'video/webm',
'video/mp4', 'video/mp4',
'video/ogg', 'video/ogg',
'video/flv', 'video/flv',
'video/x-flv' 'video/x-flv'
]); ])
} );
return $success;
} }
} }