diff --git a/CHANGELOG.md b/CHANGELOG.md index beb35b5e..873dca48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 11.21.2 +- **FEAT**(video-editor): Add `showControls` config to `VideoEditorConfigs` to allow hiding the video editor controls UI. + ## 11.21.1 - **FEAT**(text-editor): Add `resizeToAvoidBottomInset` config to control whether the editor resizes when the keyboard appears. - **FIX**(paint-editor): Resolve issue where erasing would randomly remove other layers. diff --git a/lib/core/models/editor_configs/video_editor_configs.dart b/lib/core/models/editor_configs/video_editor_configs.dart index 2fb379e6..c5276441 100644 --- a/lib/core/models/editor_configs/video_editor_configs.dart +++ b/lib/core/models/editor_configs/video_editor_configs.dart @@ -25,6 +25,7 @@ class VideoEditorConfigs { this.isAudioSupported = true, this.enablePlayButton = false, this.enableEstimatedFileSize = false, + this.showControls = true, this.controlsPosition = VideoEditorControlPosition.top, this.minTrimDuration = const Duration(seconds: 7), this.maxTrimDuration, @@ -76,6 +77,12 @@ class VideoEditorConfigs { /// limits. That mean the displayed estimated file size could be wrong. final bool enableEstimatedFileSize; + /// Whether to show the video editor controls UI. + /// + /// When set to `false`, the controls widget (play/pause, mute, trim bar, + /// etc.) will be hidden. + final bool showControls; + /// Minimum scale factor for the trim bar. final double trimBarMinScale; @@ -117,6 +124,7 @@ class VideoEditorConfigs { bool? isAudioSupported, bool? enablePlayButton, bool? enableEstimatedFileSize, + bool? showControls, double? trimBarMinScale, double? trimBarMaxScale, Duration? playTimeSmoothingDuration, @@ -139,6 +147,7 @@ class VideoEditorConfigs { enablePlayButton: enablePlayButton ?? this.enablePlayButton, enableEstimatedFileSize: enableEstimatedFileSize ?? this.enableEstimatedFileSize, + showControls: showControls ?? this.showControls, trimBarMinScale: trimBarMinScale ?? this.trimBarMinScale, trimBarMaxScale: trimBarMaxScale ?? this.trimBarMaxScale, playTimeSmoothingDuration: @@ -169,6 +178,7 @@ class VideoEditorConfigs { other.isAudioSupported == isAudioSupported && other.enablePlayButton == enablePlayButton && other.enableEstimatedFileSize == enableEstimatedFileSize && + other.showControls == showControls && other.trimBarMinScale == trimBarMinScale && other.trimBarMaxScale == trimBarMaxScale && other.playTimeSmoothingDuration == playTimeSmoothingDuration && @@ -193,6 +203,7 @@ class VideoEditorConfigs { isAudioSupported.hashCode ^ enablePlayButton.hashCode ^ enableEstimatedFileSize.hashCode ^ + showControls.hashCode ^ trimBarMinScale.hashCode ^ trimBarMaxScale.hashCode ^ playTimeSmoothingDuration.hashCode ^ diff --git a/lib/features/main_editor/widgets/main_editor_interactive_content.dart b/lib/features/main_editor/widgets/main_editor_interactive_content.dart index c306d9c8..c613002d 100644 --- a/lib/features/main_editor/widgets/main_editor_interactive_content.dart +++ b/lib/features/main_editor/widgets/main_editor_interactive_content.dart @@ -143,7 +143,7 @@ class MainEditorInteractiveContent extends StatelessWidget { _buildCropAreaOverlay(), /// Build video controls - if (isVideoEditor) + if (isVideoEditor && configs.videoEditor.showControls) AnimatedOpacity( opacity: hasSelectedLayers ? 0 : 1, duration: configs.layerInteraction.videoControlsSwitchDuration, diff --git a/pubspec.yaml b/pubspec.yaml index f605bbfc..ae24ce78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pro_image_editor description: "A Flutter image editor: Seamlessly enhance your images with user-friendly editing features." -version: 11.21.1 +version: 11.21.2 homepage: https://github.com/hm21/pro_image_editor/ repository: https://github.com/hm21/pro_image_editor/ documentation: https://github.com/hm21/pro_image_editor/