mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	* 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"};
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |