- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
}
通过打印info的信息了解到一些iOS版本之间的差异
UIImagePickerController选取相册中的视频
iOS 11.3.2
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file:///private/var/mobile/Containers/Data/Application/3B16DEED-7DFB-4742-9281-771B0E71FF60/tmp/A51C5B62-3773-4F5D-8205-4AEFD1A02104.MOV";
(iOS 11.0后可用)UIImagePickerControllerPHAsset = "<PHAsset: 0x1371505b0> 08F8D26D-F857-48C1-BABB-4F793B855809/L0/001 mediaType=2/0, sourceType=1, (1080x1920), creationDate=2016-03-06 07:09:36 +0000, location=1, hidden=0, favorite=0 ";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.MOV?id=08F8D26D-F857-48C1-BABB-4F793B855809&ext=MOV";
iOS 10.3.2
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file:///private/var/mobile/Containers/Data/Application/4221BB2A-A2D2-44A6-9AB2-F3E5E000542C/tmp/trim.9D4A46F3-6021-41FD-94F3-05FCA9F04888.MOV";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.MOV?id=7934D40B-F1E8-4F7C-9802-97CC054D6D1A&ext=MOV";
UIImagePickerController选取相册中的照片
iOS 11.3.2
(iOS 11.0后可用)UIImagePickerControllerImageURL = "file:///private/var/mobile/Containers/Data/Application/3F50588C-FAA2-4F9A-8E75-6C811EC3ED28/tmp/F8E12984-6AA0-487C-8E05-2078C30670CC.gif”;
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x101fcfb60> size {220, 125} orientation 0 scale 1.000000";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.GIF?id=D8557C64-7581-4E5F-8259-43A823C28E8F&ext=GIF";
iOS 10.3.2
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x101fcfb60> size {220, 125} orientation 0 scale 1.000000";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.GIF?id=D8557C64-7581-4E5F-8259-43A823C28E8F&ext=GIF";
UIImagePickerController拍摄的照片(参数方面无变化)
iOS 11.3.2
UIImagePickerControllerMediaMetadata = {很多数据,暂不关注}
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x101fcfb60> size {220, 125} orientation 0 scale 1.000000";
iOS 10.3.2
UIImagePickerControllerMediaMetadata = {很多数据,暂不关注}
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x17028a6e0> size {2448, 3264} orientation 3 scale 1.000000";
UIImagePickerController录制的视频(参数方面无变化)
iOS 11.3.2
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file:///private/var/mobile/Containers/Data/Application/545F485A-F559-4951-82E5-CB0B45410C5C/tmp/53855791689__7B0A3C3A-A55C-4280-A710-CBF79A89D20B.MOV";
iOS 10.3.2
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file:///private/var/mobile/Containers/Data/Application/545F485A-F559-4951-82E5-CB0B45410C5C/tmp/53855791689__7B0A3C3A-A55C-4280-A710-CBF79A89D20B.MOV";
网友评论