@@ -235,6 +235,8 @@ open class MainActivity : AppCompatActivity(),
235
235
236
236
lateinit var micOffIcon: ImageView
237
237
238
+ private var shouldRestartRecording = false
239
+
238
240
fun startFocusTimer () {
239
241
handler.postDelayed(runnable, autoCenterFocusDuration)
240
242
}
@@ -247,7 +249,8 @@ open class MainActivity : AppCompatActivity(),
247
249
ActivityResultContracts .RequestPermission ()
248
250
) { granted ->
249
251
if (granted) {
250
- videoCapturer.startRecording()
252
+ shouldRestartRecording = true
253
+ camConfig.startCamera(true )
251
254
return @registerForActivityResult
252
255
}
253
256
showAudioPermissionDeniedDialog {
@@ -655,6 +658,8 @@ open class MainActivity : AppCompatActivity(),
655
658
}
656
659
settingsIcon.isEnabled = true
657
660
}
661
+
662
+ restartRecordingIfPermissionsWasUnavailable()
658
663
} else {
659
664
previewGrid.visibility = View .INVISIBLE
660
665
val lastFrame = lastFrame
@@ -1787,4 +1792,11 @@ open class MainActivity : AppCompatActivity(),
1787
1792
}
1788
1793
1789
1794
open fun shouldShowCameraModeTabs () = true
1795
+
1796
+ private fun restartRecordingIfPermissionsWasUnavailable () {
1797
+ if (shouldRestartRecording) {
1798
+ shouldRestartRecording = false
1799
+ videoCapturer.startRecording()
1800
+ }
1801
+ }
1790
1802
}
0 commit comments