diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 187ce3a0..0b372c31 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -105,7 +105,11 @@ class VideoPlayerScreenState extends State // If this item doesn't have a playQueueItemID, it's a standalone item // Clear any existing queue so next/previous work correctly for this content if (widget.metadata.playQueueItemID == null) { - playbackState.clearShuffle(); + // Defer clearing until after the first frame to avoid calling + // notifyListeners() during build + WidgetsBinding.instance.addPostFrameCallback((_) { + playbackState.clearShuffle(); + }); } else { playbackState.setCurrentItem(widget.metadata); }