diff --git a/LFLiveKit/LFLiveSession.h b/LFLiveKit/LFLiveSession.h index c4d8b6b7..eb7c1f43 100755 --- a/LFLiveKit/LFLiveSession.h +++ b/LFLiveKit/LFLiveSession.h @@ -157,6 +157,8 @@ typedef NS_ENUM(NSInteger,LFLiveCaptureTypeMask) { /** support outer input pcm audio(set LFLiveCaptureTypeMask) .*/ - (void)pushAudio:(nullable NSData*)audioData; -(void)loadCustomFilter:(int)input; +- (void) turnFlashLightOff; +- (void) turnFlashLightOn; @end diff --git a/LFLiveKit/LFLiveSession.m b/LFLiveKit/LFLiveSession.m index 793507e8..1f74feb1 100755 --- a/LFLiveKit/LFLiveSession.m +++ b/LFLiveKit/LFLiveSession.m @@ -428,5 +428,13 @@ - (BOOL)AVAlignment{ return YES; } } +- (void) turnFlashLightOff{ + [_videoCaptureSource turnFlashLightOff]; + +} + +- (void) turnFlashLightOn{ + [_videoCaptureSource turnFlashLightOn]; +} @end diff --git a/LFLiveKit/capture/LFVideoCapture.h b/LFLiveKit/capture/LFVideoCapture.h index bfb264c2..837bebb3 100755 --- a/LFLiveKit/capture/LFVideoCapture.h +++ b/LFLiveKit/capture/LFVideoCapture.h @@ -81,4 +81,6 @@ */ - (nullable instancetype)initWithVideoConfiguration:(nullable LFLiveVideoConfiguration *)configuration NS_DESIGNATED_INITIALIZER; -(void)loadCustomFilter:(int)input; +- (void) turnFlashLightOff; +- (void) turnFlashLightOn; @end diff --git a/LFLiveKit/capture/LFVideoCapture.m b/LFLiveKit/capture/LFVideoCapture.m index 7514ffd0..214181be 100755 --- a/LFLiveKit/capture/LFVideoCapture.m +++ b/LFLiveKit/capture/LFVideoCapture.m @@ -70,6 +70,14 @@ - (void)dealloc { } } + +- (void) turnFlashLightOn{ + [_videoCamera.inputCamera setTorchModeOnWithLevel:1.0 error:nil]; +} + +- (void) turnFlashLightOff{ + [_videoCamera.inputCamera setTorchModeOnWithLevel:0 error:nil]; +} #pragma mark -- Setter Getter - (GPUImageVideoCamera *)videoCamera{