Skip to content

fix: Improve startPosition support in players#894

Merged
PartyDonut merged 2 commits intoDonutWare:developfrom
schembriaiden:feat/move-seek-to-backend
Apr 4, 2026
Merged

fix: Improve startPosition support in players#894
PartyDonut merged 2 commits intoDonutWare:developfrom
schembriaiden:feat/move-seek-to-backend

Conversation

@schembriaiden
Copy link
Copy Markdown
Contributor

@schembriaiden schembriaiden commented Mar 31, 2026

Pull Request Description

This pull request introduces consistent support for starting video playback from a specified position across the entire playback stack. The changes ensure that the startPosition parameter is correctly propagated and respected by all player implementations and playback helpers. Additionally, the logic for determining the initial playback position has been improved, defaulting to a saved or provided position as appropriate.

Playback start position propagation and handling:

  • All player interfaces and implementations (BasePlayer, LibMDK, LibMPV, NativePlayer, and their web stubs) now accept an optional startPosition parameter in the loadVideo method, ensuring that playback can start from the correct position across all platforms.
  • The MediaControlsWrapper and VideoPlayerNotifier classes have been updated to pass the startPosition to the player and to handle playback state updates accordingly, including calling playbackStarted when playback begins.

Improved logic for determining playback start position:

  • The helpers and model logic now use a fallback mechanism that chooses the most appropriate start position (either the provided startPosition, a saved resume position, or zero if none are available).

These changes collectively ensure a more robust and user-friendly resume playback experience, with consistent handling of playback positions throughout the codebase.

Just as a disclaimer I did use Antigravity Agent to create this PR, so if you think somethings don't make sense or the PR looks more like a workaround rather than a fix let me know.

Issue Being Fixed

Solves 2 issues:

  • When seeking too fast it now no longer gets stuck with the black screen and play button which makes you start from the beginning.
  • On Android, it now always starts where it left off last.

Resolves #770, #565

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

@schembriaiden schembriaiden marked this pull request as ready for review March 31, 2026 12:01
@schembriaiden schembriaiden force-pushed the feat/move-seek-to-backend branch from ddd79e6 to d1bf570 Compare March 31, 2026 12:17
Copy link
Copy Markdown
Collaborator

@PartyDonut PartyDonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I combined the same calls into a new function but everything else seems good thanks!

@PartyDonut PartyDonut added the bug Something isn't working label Apr 4, 2026
@PartyDonut PartyDonut changed the title feat: Implement startPosition support in player loading fix: Improve startPosition support in players Apr 4, 2026
@PartyDonut PartyDonut merged commit 63b135d into DonutWare:develop Apr 4, 2026
1 check passed
@github-project-automation github-project-automation bot moved this to Done in Fladder Apr 4, 2026
@schembriaiden schembriaiden deleted the feat/move-seek-to-backend branch April 4, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 Progress reset back to start

2 participants