mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-13 01:10:31 -07:00
fix: Spamming playback state with certain players
This commit is contained in:
parent
13ebaee35f
commit
9689d74109
1 changed files with 5 additions and 5 deletions
|
|
@ -75,12 +75,12 @@ class VideoPlayerNotifier extends StateNotifier<MediaControlsWrapper> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updatePlaying(bool event) async {
|
Future<void> updatePlaying(bool event) async {
|
||||||
if (!state.hasPlayer) return;
|
|
||||||
mediaState.update(
|
|
||||||
(state) => state.playing == event ? state : state.copyWith(playing: event),
|
|
||||||
);
|
|
||||||
final currentState = playbackState;
|
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 {
|
Future<void> updatePosition(Duration event) async {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue