mirror of
https://github.com/immich-app/immich.git
synced 2024-12-21 01:39:59 +02:00
97dc7660b4
* Implementing video upload features * setup image resize processor * Add video thumbnail with duration and icon * Fixed issue with video upload timeout and upper case file type on ios * Added video player page * Added video player page * Fixing video player not play on ios * Added partial file streaming for ios/android video request * Added nginx as proxy server for better file serving * update nginx and docker-compose file * Video player working correctly * Video player working correctly * Split duration to the second
36 lines
870 B
Dart
36 lines
870 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:path/path.dart' as p;
|
|
|
|
class FileHelper {
|
|
static getMimeType(String filePath) {
|
|
debugPrint(filePath);
|
|
var fileExtension = p.extension(filePath).split(".")[1];
|
|
|
|
switch (fileExtension.toLowerCase()) {
|
|
case 'gif':
|
|
return {"type": "image", "subType": "gif"};
|
|
|
|
case 'jpeg':
|
|
return {"type": "image", "subType": "jpeg"};
|
|
|
|
case 'jpg':
|
|
return {"type": "image", "subType": "jpeg"};
|
|
|
|
case 'png':
|
|
return {"type": "image", "subType": "png"};
|
|
|
|
case 'mov':
|
|
return {"type": "video", "subType": "quicktime"};
|
|
|
|
case 'mp4':
|
|
return {"type": "video", "subType": "mp4"};
|
|
|
|
case 'avi':
|
|
return {"type": "video", "subType": "x-msvideo"};
|
|
|
|
default:
|
|
return {"type": "unsupport", "subType": "unsupport"};
|
|
}
|
|
}
|
|
}
|