请求用户相册权限时,用户选择了限制访问引起的异常处理
1、如果想拿到 PHAsset
完全访问:
PHAsset *asset = info[UIImagePickerControllerPHAsset];
限制访问:
info[UIImagePickerControllerPHAsset] = nil
2、想拿到视频时长
完全访问:
asset.duration;
限制访问:
NSURL *selectUrl = info[UIImagePickerControllerMediaURL]; NSDictionary *dic = @{AVURLAssetPreferPreciseDurationAndTimingKey:@(YES)}; AVURLAsset *audioAsset = [AVURLAsset URLAssetWithURL:selectUrl options:dic];
CMTime audioDuration = audioAsset.duration;
audioDurationSeconds = CMTimeGetSeconds(audioDuration);
本文标题:请求用户相册权限时,用户选择了限制访问引起的异常处理
本文链接:https://www.haomeiwen.com/subject/fbbfcjtx.html
网友评论