feat: Previous and next chapter buttons - #1063
Open
alex-rans wants to merge 2 commits into
Open
Conversation
PartyDonut
requested changes
Aug 9, 2026
PartyDonut
left a comment
Collaborator
There was a problem hiding this comment.
Functionality looks good, have some small requests.
| final chapters = ref.read(playBackModel.select((value) => value?.chapters)) ?? []; | ||
| if (chapters.isEmpty) return; | ||
| final position = ref.read(mediaPlaybackProvider).position; | ||
| final threshold = const Duration(milliseconds: 3000); |
Collaborator
There was a problem hiding this comment.
There is a extension in chapters_model.dart lets move the next/previous lookups in there and only pass the required paramaters to fetch previous/next chapters.
That way we can re-use it when needed.
Comment on lines
+741
to
+747
| if (next != null) { | ||
| ref.read(videoPlayerProvider).seek(next.startPosition); | ||
| } else { | ||
| // fallback: load next video | ||
| final nextVideo = ref.read(playBackModel.select((value) => value?.nextVideo)); | ||
| if (nextVideo != null) ref.read(playbackModelHelper).loadNewVideo(nextVideo); | ||
| } |
Collaborator
There was a problem hiding this comment.
I'm not sure about loading the next video. Would it not be better to disable the next chapter button if there is no next chapter?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Added previous and next chapter buttons in the video player. This has not been added to tv_player_controls.dart, but I will (probably) add this in another PR.
Issue Being Fixed
None, besides my mild annoyance
Screenshots / Recordings
Tested On
Checklist