Commit d212ac4f authored by 林生雨's avatar 林生雨

commit

parent a4dd2854
...@@ -78,8 +78,7 @@ NSString *cacheDirectory; ...@@ -78,8 +78,7 @@ NSString *cacheDirectory;
else if(author == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) { else if(author == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) {
NSLog(@"没给权限!!!"); NSLog(@"没给权限!!!");
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"; NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [self popWindow:errorStr];
[alert show];
}else { }else {
NSLog(@"HERRRRRRRR"); NSLog(@"HERRRRRRRR");
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
...@@ -93,8 +92,7 @@ NSString *cacheDirectory; ...@@ -93,8 +92,7 @@ NSString *cacheDirectory;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
// 用户点击 不允许访问 // 用户点击 不允许访问
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"; NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [self popWindow:errorStr];
[alert show];
NSLog(@"被拒绝 TODO!!"); NSLog(@"被拒绝 TODO!!");
}); });
} }
...@@ -113,9 +111,7 @@ NSString *cacheDirectory; ...@@ -113,9 +111,7 @@ NSString *cacheDirectory;
else if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){ else if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相机”选项中,允许好享玩访问你的相机。"; NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相机”选项中,允许好享玩访问你的相机。";
NSLog(@"相机不可用"); NSLog(@"相机不可用");
[self popWindow:errorStr];
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
}else { }else {
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
if(granted){ if(granted){
...@@ -124,8 +120,7 @@ NSString *cacheDirectory; ...@@ -124,8 +120,7 @@ NSString *cacheDirectory;
}); });
}else{ }else{
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"; NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [self popWindow:errorStr];
[alert show];
} }
}]; }];
} }
...@@ -925,6 +920,17 @@ CFAbsoluteTime startTime; ...@@ -925,6 +920,17 @@ CFAbsoluteTime startTime;
return videoDurationText; return videoDurationText;
} }
-(void)popWindow:(NSString*)str{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:str preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"确定");
}];
[alertController addAction:okAction];
[viewController presentViewController:alertController animated:YES completion:nil];
}
//-(void)execRealImg:(long)resultId{ //-(void)execRealImg:(long)resultId{
// dispatch_queue_t queue = dispatch_queue_create("execRealImg", DISPATCH_QUEUE_CONCURRENT); // dispatch_queue_t queue = dispatch_queue_create("execRealImg", DISPATCH_QUEUE_CONCURRENT);
// self.nowSize=0; // self.nowSize=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment