File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -373,8 +373,6 @@ class CameraPickerState extends State<CameraPicker>
373
373
/// 通过常量全局 Key 获取当前选择器的主题
374
374
ThemeData get theme => _theme;
375
375
376
- bool _isPreparedForIOSRecording = false ;
377
-
378
376
@override
379
377
void initState () {
380
378
super .initState ();
@@ -507,7 +505,10 @@ class CameraPickerState extends State<CameraPicker>
507
505
508
506
try {
509
507
await controller.initialize ();
510
- Future .wait <void >(< Future <dynamic >> [
508
+ if (shouldPrepareForVideoRecording) {
509
+ await controller.prepareForVideoRecording ();
510
+ }
511
+ Future .wait (< Future <void >> [
511
512
(() async => _maxAvailableExposureOffset =
512
513
await controller.getMaxExposureOffset ())(),
513
514
(() async => _minAvailableExposureOffset =
@@ -778,10 +779,6 @@ class CameraPickerState extends State<CameraPicker>
778
779
/// 设置拍摄文件路径并开始录制视频
779
780
Future <void > startRecordingVideo () async {
780
781
if (! controller.value.isRecordingVideo) {
781
- if (! _isPreparedForIOSRecording) {
782
- await controller.prepareForVideoRecording ();
783
- _isPreparedForIOSRecording = true ;
784
- }
785
782
controller.startVideoRecording ().then ((dynamic _) {
786
783
safeSetState (() {});
787
784
if (isRecordingRestricted) {
You can’t perform that action at this time.
0 commit comments