File tree 1 file changed +4
-2
lines changed
app/src/main/java/app/grapheneos/camera/capturer 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ class VideoCapturer(private val mActivity: MainActivity) {
150
150
fun startRecording () {
151
151
if (camConfig.camera == null ) return
152
152
val recorder = camConfig.videoCapture?.output ? : return
153
+ if (isRecording) return
154
+ isRecording = true
153
155
154
156
val dateString = SimpleDateFormat (" yyyyMMdd_HHmmss" , Locale .US ).format(Date ())
155
157
val fileName = VIDEO_NAME_PREFIX + dateString + videoFileFormat
@@ -163,6 +165,7 @@ class VideoCapturer(private val mActivity: MainActivity) {
163
165
includeAudio = true
164
166
} else {
165
167
ctx.restartRecordingWithMicPermission()
168
+ isRecording = false
166
169
return
167
170
}
168
171
}
@@ -175,6 +178,7 @@ class VideoCapturer(private val mActivity: MainActivity) {
175
178
camConfig.onStorageLocationNotFound()
176
179
}
177
180
ctx.showMessage(R .string.unable_to_access_output_file)
181
+ isRecording = false
178
182
return
179
183
}
180
184
@@ -186,8 +190,6 @@ class VideoCapturer(private val mActivity: MainActivity) {
186
190
187
191
beforeRecordingStarts()
188
192
189
- isRecording = true
190
-
191
193
camConfig.mPlayer.playVRStartSound(handler) {
192
194
193
195
recording = pendingRecording.start(ctx.mainExecutor) { event ->
You can’t perform that action at this time.
0 commit comments