Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/providers/video_player_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class VideoPlayerNotifier extends StateNotifier<MediaControlsWrapper> {
mediaState.update(
(state) => state.copyWith(playing: event),
);
ref.read(playBackModel)?.updatePlaybackPosition(currentState.position, currentState.playing, ref);
ref.read(playBackModel)?.updatePlaybackPosition(currentState.position, event, ref);
}

Future<void> updatePosition(Duration event) async {
Expand Down
11 changes: 11 additions & 0 deletions lib/screens/video_player/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,21 @@ class _VideoPlayerState extends ConsumerState<VideoPlayer> with WidgetsBindingOb
super.dispose();
}

void _setupListeners() {
ref.listenManual(
mediaPlaybackProvider.select((value) => value.playing),
(previous, next) {
playing = next;
},
fireImmediately: true,
);
}

@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
_setupListeners();
Future.microtask(() {
ref.read(mediaPlaybackProvider.notifier).update((state) => state.copyWith(state: VideoPlayerState.fullScreen));
final orientations = ref.read(videoPlayerSettingsProvider.select((value) => value.allowedOrientations));
Expand Down
Loading