mirror of
https://github.com/status-im/react-native-image-crop-picker.git
synced 2025-02-23 02:48:12 +00:00
commit
8eeb267476
@ -11,16 +11,20 @@
|
||||
@implementation Compression
|
||||
|
||||
- (instancetype)init {
|
||||
self.exportPresets = @{
|
||||
@"640x480": AVAssetExportPreset640x480,
|
||||
@"960x540": AVAssetExportPreset960x540,
|
||||
@"1280x720": AVAssetExportPreset1280x720,
|
||||
@"1920x1080": AVAssetExportPreset1920x1080,
|
||||
@"3840x2160": AVAssetExportPreset3840x2160,
|
||||
@"LowQuality": AVAssetExportPresetLowQuality,
|
||||
@"MediumQuality": AVAssetExportPresetMediumQuality,
|
||||
@"HighestQuality": AVAssetExportPresetHighestQuality,
|
||||
};
|
||||
NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:@{
|
||||
@"640x480": AVAssetExportPreset640x480,
|
||||
@"960x540": AVAssetExportPreset960x540,
|
||||
@"1280x720": AVAssetExportPreset1280x720,
|
||||
@"1920x1080": AVAssetExportPreset1920x1080,
|
||||
@"LowQuality": AVAssetExportPresetLowQuality,
|
||||
@"MediumQuality": AVAssetExportPresetMediumQuality,
|
||||
@"HighestQuality": AVAssetExportPresetHighestQuality,
|
||||
}];
|
||||
NSOperatingSystemVersion systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
|
||||
if (systemVersion.majorVersion >= 9) {
|
||||
[dic addEntriesFromDictionary:@{@"3840x2160": AVAssetExportPreset3840x2160}];
|
||||
}
|
||||
self.exportPresets = dic;
|
||||
|
||||
return self;
|
||||
}
|
||||
@ -74,9 +78,9 @@
|
||||
}
|
||||
|
||||
- (void)compressVideo:(NSURL*)inputURL
|
||||
outputURL:(NSURL*)outputURL
|
||||
withOptions:(NSDictionary*)options
|
||||
handler:(void (^)(AVAssetExportSession*))handler {
|
||||
outputURL:(NSURL*)outputURL
|
||||
withOptions:(NSDictionary*)options
|
||||
handler:(void (^)(AVAssetExportSession*))handler {
|
||||
|
||||
NSString *presetKey = [options valueForKey:@"compressVideoPreset"];
|
||||
if (presetKey == nil) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user