fix(player): Keep the scrub bar through renewals #19
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/scrub-renewal-focus"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's wrong
Time-shift is what plays after you pause live TV and resume: the channel runs behind live, from what the provider has recorded. The player asks the provider for a window, the stretch it had recorded at that moment. So time-shift renews the window on its own: 30 seconds before playback reaches the window's end, and again if the stream runs dry.
The scrub bar is the progress bar under the programme title. Down focuses it, and then Left and Right seek. The player treated every renewal like a stream the user had asked for, so each renewal released the bar. The next Left opened the Channels panel and the next Right opened Options, instead of seeking. A seek still waiting to run was thrown away. Scrubbing to the end of the window triggers a renewal straight away, so it happened most there.
What changed
A flag on the archive state,
ArchiveState.renewal, marks a renewal, and a renewal leaves the scrub bar alone:A new catch-up, Start over, or resuming from a pause still releases the bar, as before. Catch-up plays a programme that already aired, from the provider's archive. Start over, in the Guide, plays the current programme from its beginning. The rules live in
feature/player/TimeShiftRenewal.kt, so they're unit-tested without a player.Not a goal: scrubbing back past where a renewal started. The new window starts at the carried-over seek's target, or at the playback position when no seek is waiting, so anything earlier is outside it. That was already true before this change.
Checks
testDebugUnitTest: 534 pass, 8 of them new inTimeShiftRenewalTest.lintDebug: 0 errors, 11 warnings (unchanged).assembleDebug: OK.continueTimeShift.Screenshots
I'll add these in a comment:
Intent: when time-shift renews its recorded window on its own, the scrub bar keeps its focus and any seek the user is still choosing. A pending seek is carried into the renewal, so the new stream opens once, at the seek's target.
Not a goal: