Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix: Switch to original video playback

Neeraj Gupta55264445b250
diff --git a/mobile/lib/ui/viewer/file/video_widget_native.dart b/mobile/lib/ui/viewer/file/video_widget_native.dart
index 68653265c7..b84cdc0e3c 100644
--- a/mobile/lib/ui/viewer/file/video_widget_native.dart
+++ b/mobile/lib/ui/viewer/file/video_widget_native.dart
@@ -112,6 +112,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
_streamSwitchedSubscription =
Bus.instance.on<StreamSwitchedEvent>().listen((event) {
if (event.type != PlayerType.nativeVideoPlayer) return;
+ _filePath = null;
if (event.selectedPreview) {
loadPreview(update: true);
} else {
@@ -133,6 +134,11 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
}
Future<void> setVideoSource() async {
+ if (_filePath == null) {
+ _logger.info('Stop video player, file path is null');
+ await _controller?.stop();
+ return;
+ }
final videoSource = VideoSource(
path: _filePath!,
type: VideoSourceType.file,