buildVideoCapturePickerConfig function
CameraPickerConfig
buildVideoCapturePickerConfig({})
华为部分机型无法初始化 textureView 视频预览,使用 platformView 解码。
Implementation
@visibleForTesting
CameraPickerConfig buildVideoCapturePickerConfig({
required Future<void> Function(File file) onVideoSaved,
}) => CameraPickerConfig(
enableRecording: true,
onlyEnableRecording: true,
enableTapRecording: true,
maximumRecordingDuration: const Duration(seconds: 9),
previewVideoViewType: VideoViewType.platformView,
textDelegate: const CameraPickerTextDelegate(),
onEntitySaving: (context, viewType, previewFile) async {
await onVideoSaved(previewFile);
if (context.mounted) {
Navigator.of(context)
..pop()
..pop();
}
},
);