Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): show play instead of replay button for unplayed videos (#32307)

Luis Nachtigall0d1e1ffecd5d
diff --git a/mobile/lib/providers/asset_viewer/video_player_provider.dart b/mobile/lib/providers/asset_viewer/video_player_provider.dart
index 16df19540f..b2081697a2 100644
--- a/mobile/lib/providers/asset_viewer/video_player_provider.dart
+++ b/mobile/lib/providers/asset_viewer/video_player_provider.dart
@@ -189,10 +189,21 @@ class VideoPlayerNotifier extends StateNotifier<VideoPlayerState> {
return;
}
+ var status = _mapStatus(playbackInfo.status);
+ if (playbackInfo.status == PlaybackStatus.stopped && state.status != VideoPlaybackStatus.completed) {
+ // Never played yet, not completed = we show the resume button instead of the replay button
+ status = VideoPlaybackStatus.paused;
+ }
+
+ if (status != VideoPlaybackStatus.playing) {
+ // No playback = no loading indicator needed
+ _bufferingTimer?.cancel();
+ }
+
state = state.copyWith(
position: Duration(milliseconds: playbackInfo.position),
duration: Duration(milliseconds: videoInfo.duration),
- status: _mapStatus(playbackInfo.status),
+ status: status,
);
}