开发者

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:

  1. User taps a video from the library (UIImagePickerController)
  2. Preview screen shows
  3. User taps Choose button
  4. Compressing Video progress bar appears.
  5. imagePickerController:didFinishPickingMediaWithInfo delegate is being called.
  6. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜