[READ ONLY MIRROR] Open Source TikTok alternative built on AT Protocol github.com/sprksocial/client
flutter atproto video dart
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(editor): don't crash with unsupported video format

+45 -1
+32
lib/src/core/pro_video_editor/ui/video_editor_grounded_page.dart
··· 194 194 onToggleMute: _onToggleMute, 195 195 onAddSound: _showAudioSelectionBottomSheet, 196 196 onToggleFullscreen: _openFullscreenPreview, 197 + onBeforeExport: _checkCanExport, 197 198 ); 198 199 199 200 // Update clip duration and thumbnails after first frame ··· 471 472 if (selectedTrack != null) { 472 473 setState(() {}); 473 474 } 475 + } 476 + 477 + /// Checks if the video can be exported. 478 + /// Returns true if export is allowed, false otherwise. 479 + Future<bool> _checkCanExport() async { 480 + final videoPath = _video.file?.path; 481 + final isUnsupportedFormat = 482 + videoPath != null && videoPath.toLowerCase().endsWith('.mov') && videoPath.contains('image_picker'); 483 + 484 + if (isUnsupportedFormat) { 485 + if (mounted) { 486 + await showDialog<void>( 487 + context: context, 488 + builder: (context) => AlertDialog( 489 + title: const Text('Export Not Supported'), 490 + content: const Text( 491 + 'This video format cannot be exported due to compatibility issues. ' 492 + 'Please try recording or selecting a different video.', 493 + ), 494 + actions: [ 495 + TextButton( 496 + onPressed: () => Navigator.pop(context), 497 + child: const Text('OK'), 498 + ), 499 + ], 500 + ), 501 + ); 502 + } 503 + return false; 504 + } 505 + return true; 474 506 } 475 507 476 508 /// Generates the final video based on the given [parameters].
+13 -1
lib/src/core/pro_video_editor/ui/widgets/common/video_editor_configs_builder.dart
··· 36 36 required VoidCallback onToggleMute, 37 37 required VoidCallback onAddSound, 38 38 required VoidCallback onToggleFullscreen, 39 + Future<bool> Function()? onBeforeExport, 39 40 List<AudioTrack> audioTracks = const [], 40 41 VideoEditorConfigs videoEditorConfigs = const VideoEditorConfigs( 41 42 initialMuted: true, ··· 111 112 bottom: false, 112 113 child: VideoEditorHeader( 113 114 onBack: editor.closeEditor, 114 - onNext: editor.doneEditing, 115 + onNext: () { 116 + // Check if export is allowed before proceeding 117 + if (onBeforeExport != null) { 118 + onBeforeExport().then((canExport) { 119 + if (canExport) { 120 + editor.doneEditing(); 121 + } 122 + }); 123 + } else { 124 + editor.doneEditing(); 125 + } 126 + }, 115 127 ), 116 128 ), 117 129 ),