Showing
2 changed files
with
1 additions
and
14 deletions
No preview for this file type
@@ -570,21 +570,8 @@ | @@ -570,21 +570,8 @@ | ||
570 | [self toastTip:@"前置摄像头不存在闪光灯。"]; | 570 | [self toastTip:@"前置摄像头不存在闪光灯。"]; |
571 | return; | 571 | return; |
572 | } | 572 | } |
573 | - | ||
574 | - AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | ||
575 | - | 573 | + [_livePush toggleTorch:!sender.selected]; |
576 | sender.selected = !sender.selected; | 574 | sender.selected = !sender.selected; |
577 | - | ||
578 | - if ([device hasTorch] && [device hasFlash]){ | ||
579 | - | ||
580 | - [device lockForConfiguration:nil]; | ||
581 | - if (sender.selected) { | ||
582 | - [device setTorchMode:AVCaptureTorchModeOn]; | ||
583 | - } else { | ||
584 | - [device setTorchMode:AVCaptureTorchModeOff]; | ||
585 | - } | ||
586 | - [device unlockForConfiguration]; | ||
587 | - } | ||
588 | } | 575 | } |
589 | 576 | ||
590 | - (void)liveButtonPressed:(UIButton *)sender { | 577 | - (void)liveButtonPressed:(UIButton *)sender { |
-
Please register or login to post a comment