fix: Spamming playback state with certain players

This commit is contained in:
PartyDonut 2025-10-03 15:09:35 +02:00
parent 13ebaee35f
commit 9689d74109

View file

@ -75,12 +75,12 @@ class VideoPlayerNotifier extends StateNotifier<MediaControlsWrapper> {
}
Future<void> updatePlaying(bool event) async {
if (!state.hasPlayer) return;
mediaState.update(
(state) => state.playing == event ? state : state.copyWith(playing: event),
);
final currentState = playbackState;
ref.read(playBackModel)?.updatePlaybackPosition(currentState.position, playbackState.playing, ref);
if (!state.hasPlayer || currentState.playing == event) return;
mediaState.update(
(state) => state.copyWith(playing: event),
);
ref.read(playBackModel)?.updatePlaybackPosition(currentState.position, currentState.playing, ref);
}
Future<void> updatePosition(Duration event) async {