Fix video history playback and resume functionality#242
Fix video history playback and resume functionality#242google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
This commit addresses an issue where video playback history and resume-from-breakpoint functionality would fail when the video streaming account differed from the history tracking account. The solution involves the following changes: - The `videoUrl` method in `lib/http/video.dart` has been updated to accept an optional `Account` parameter. This allows the caller to specify which user account context should be used for the API request. - The `queryVideoUrl` method in `lib/pages/video/controller.dart` now passes `Accounts.history` when fetching video playback information. This ensures that the last played time is retrieved for the correct user. - The logic for determining whether a video has been fully watched has been corrected. It now compares the `lastPlayTime` with the video's total `timeLength` to accurately decide whether to restart the video from the beginning.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the video playback history feature to ensure videos resume correctly from the saved playback position when different accounts are used for streaming and history tracking. It also implements logic to restart videos from the beginning when they have been fully watched (within 400ms of completion).
Key Changes:
- Added account parameter support to the video URL API to enable separate history tracking accounts
- Implemented logic to detect fully watched videos and restart them from the beginning instead of resuming near the end
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/pages/video/controller.dart | Adds Accounts.history parameter to video URL requests and implements logic to reset playback position to the beginning for fully watched videos |
| lib/http/video.dart | Adds optional Account parameter to videoUrl method and passes it through the request options to enable account-specific history tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } else if (defaultST == null) { | ||
| if (data.lastPlayTime != null && | ||
| data.timeLength != null && | ||
| data.lastPlayTime! >= data.timeLength! - 400) { |
There was a problem hiding this comment.
The condition for determining if a video should restart from the beginning only checks if lastPlayTime >= timeLength - 400. However, lastPlayTime and timeLength are in milliseconds, so the 400ms threshold might be too small. Consider if this should be a larger value (e.g., 1000-5000ms) to provide a better user experience, as users who stopped within the last 400ms of a video might prefer to resume rather than restart.
| data.lastPlayTime! >= data.timeLength! - 400) { | |
| data.lastPlayTime! >= data.timeLength! - 3000) { |
This change fixes a bug in the video playback history feature, ensuring that the resume-from-breakpoint functionality works correctly when the video streaming and history tracking accounts are different. It also ensures that videos marked as fully watched will restart from the beginning.
Fixes #239
PR created automatically by Jules for task 9830854864461448368 started by @UcnacDx2