Skip to content

Commit

Permalink
Flashlight possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vasicvuk committed Mar 24, 2017
1 parent 94bc195 commit 0ab57b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LFLiveKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "LFLiveKit"
s.version = "2.7"
s.version = "2.8"
s.summary = "LaiFeng ios Live. LFLiveKit."
s.homepage = "https://github.com/chenliming777"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
13 changes: 11 additions & 2 deletions LFLiveKit/capture/LFVideoCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,20 @@ - (void)dealloc {


- (void) turnFlashLightOn{
[_videoCamera.inputCamera setTorchModeOnWithLevel:1.0 error:nil];
if(_videoCamera.inputCamera.hasTorch){
[_videoCamera.inputCamera lockForConfiguration:nil];
_videoCamera.inputCamera.torchMode = AVCaptureTorchModeOn;
[_videoCamera.inputCamera setTorchModeOnWithLevel:1.0 error:nil];
[_videoCamera.inputCamera unlockForConfiguration];
}
}

- (void) turnFlashLightOff{
[_videoCamera.inputCamera setTorchModeOnWithLevel:0 error:nil];
if(_videoCamera.inputCamera.hasTorch){
[_videoCamera.inputCamera lockForConfiguration:nil];
_videoCamera.inputCamera.torchMode = AVCaptureTorchModeOff;
[_videoCamera.inputCamera unlockForConfiguration];
}
}
#pragma mark -- Setter Getter

Expand Down

0 comments on commit 0ab57b4

Please sign in to comment.