A way to check chosen video file from UIImagePickerController before compression?
I need to check if the chosen video file had not been chosen before
Actually the scenario looks like:
- User taps a video from the library (UIImagePickerController)
- Preview screen shows
- User taps Choose button
- Compressing Video progress bar appears.
- imagePickerController:didFinishPickingMediaWithInfo delegate is being called.
- Here I can check if the chosen video file had not been chosen before.
The problem is the time of compression (if the chose file is large) can take several minutes.
So the questions is:
Is there a way to check the chosen video file fr开发者_如何学JAVAom UIImagePickerController before the compression starts?
This is not possible as far as I can tell with UIImagePickerController. You may want to look into the ALAssetsLibrary.framework for another way to achieve the result you're looking for.
Add Framework- CoreMedia.Framework
import "MobileCoreServices/UTCoreTypes.h"
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
if ([type isEqualToString:(NSString *)kUTTypeVideo] ||
[type isEqualToString:(NSString *)kUTTypeMovie]) {
}
}
It will show only videos in the Album.
精彩评论