Question about iPhone 3GS Image Picker Controller

I am writing a simple video uploader application on iPhone 3GS where I first direct the user to photos album, and then select the video to share or upload. I am using the UIImagePickerController in the following way:

videoPickerCtrl = [[UIImagePickerController alloc] init]; videoPickerCtrl.delegate = self; videoPickerCtrl.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; videoPickerCtrl.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:videoPickerCtrl.sourceType];

videoPickerCtrl.allowsImageEditing = NO; videoPickerCtrl.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]; [window addSubview:videoPickerCtrl.view];

But I can see that once the controller is invoked, there is a disturbing video trimming interface that is presented. Once I press "choose", the video is always trimmed no matter whether I touch the trimming controls or not. Is there any way to get around this trimming interface and directly get the path of the video file ?


You don't specify what version of the iPhone SDK that you're using.

If you're using SDK 3.0, there's no way that I'm aware of to eliminate the trimming interface.

If you're using SDK 3.1, try setting UIImagePickerController.allowsEditing to false. In 3.1 the allowsImageEditing has been deprecated for a more general allowsEditing property.


The trimming you see is the iphone copying the video file into your apps tmp directory allowing you to access it. Look up iphone app sandboxing if you still don't get it.

链接地址: http://www.djcxy.com/p/84294.html

上一篇:

下一篇: 关于iPhone 3GS图像选择器控制器的问题