...
|
...
|
@@ -570,21 +570,8 @@ |
|
|
[self toastTip:@"前置摄像头不存在闪光灯。"];
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
|
|
|
|
|
[_livePush toggleTorch:!sender.selected];
|
|
|
sender.selected = !sender.selected;
|
|
|
|
|
|
if ([device hasTorch] && [device hasFlash]){
|
|
|
|
|
|
[device lockForConfiguration:nil];
|
|
|
if (sender.selected) {
|
|
|
[device setTorchMode:AVCaptureTorchModeOn];
|
|
|
} else {
|
|
|
[device setTorchMode:AVCaptureTorchModeOff];
|
|
|
}
|
|
|
[device unlockForConfiguration];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- (void)liveButtonPressed:(UIButton *)sender {
|
...
|
...
|
|