allow toggling flashlight during recording too

This commit is contained in:
tibbi 2018-06-06 22:48:22 +02:00
parent f83a841ae4
commit 40bc253bd8
1 changed files with 2 additions and 3 deletions

View File

@ -831,7 +831,7 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
} }
override fun checkFlashlight() { override fun checkFlashlight() {
if (mCameraState == STATE_PREVIEW && mIsFlashSupported) { if ((mCameraState == STATE_PREVIEW || mCameraState == STATE_RECORDING) && mIsFlashSupported) {
setFlashAndExposure(mPreviewRequestBuilder!!) setFlashAndExposure(mPreviewRequestBuilder!!)
mPreviewRequest = mPreviewRequestBuilder!!.build() mPreviewRequest = mPreviewRequestBuilder!!.build()
mCaptureSession?.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler) mCaptureSession?.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler)
@ -839,8 +839,7 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
} }
} }
override fun deviceOrientationChanged() { override fun deviceOrientationChanged() {}
}
override fun resumeCamera() = true override fun resumeCamera() = true