Skip to content

Apply skip-time changes to a running player - #1198

Closed
r0adkll wants to merge 2 commits into
refactor/settings-async-1cfrom
fix/live-skip-times
Closed

r0adkll wants to merge 2 commits into
refactor/settings-async-1cfrom
fix/live-skip-times

Conversation

@r0adkll

@r0adkll r0adkll commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Stack

Found while testing #607.

Changing the skip forward or back time in Settings → Playback updated the player's button labels straight away, but the actual skips kept the old amounts until the app restarted. The cause is that ExoPlayer took its seek increments once, from the builder, when the player was created. main has the same bug.

What changed

  • ExoPlayerAudioPlayer collects PlayerSettingsSnapshot.forwardTime and backwardTime in its main-thread scope, and pushes them into ExoPlayer's runtime setSeekForwardIncrementMs/setSeekBackIncrementMs (added in Media3 1.11).
  • Desktop and iOS already read the snapshot on every skip, so only Android needed this.
  • Changelog entry added under Fixed.

Verification

  • ./scripts/ktlint --check passes, Android (alpha debug) compiles, and :infra:audioplayer:impl:jvmTest passes.
  • On device (emulator, local testbed server, fossDebug, one app session with no restart):
Settings (forward / back) Trigger Result
30s / 10s in-app buttons +30s, −10s
5s / 30s in-app buttons +5s, −30s
10s / 5s cmd media_session dispatch fast-forward / rewind +10s, −5s
10s / 5s notification buttons +10s, −5s

There were no crashes.

🤖 Generated with Claude Code

ExoPlayer took its seek increments once, when it was built, so changing
the forward or back skip in Settings only took effect after the app
restarted. Follow the player settings and push changes into ExoPlayer's
runtime increment setters.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Messages
📖 This PR has been checked by Danger

Generated by 🚫 Danger Kotlin against d0b8b93

@Rotom-Bot

Copy link
Copy Markdown
Collaborator

Code Coverage

Total Project Coverage 23.49% ❌

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Android APK @ 064079f

@r0adkll

r0adkll commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

Closing: #607 is taking a simpler direction. Settings stay on the existing preference-backed store (no async API or DataStore), and only the library view settings become per-account, through user-id-prefixed keys in that same store. #1189 stays as the base.

@r0adkll r0adkll closed this Oct 6, 2026
r0adkll added a commit that referenced this pull request Oct 6, 2026
Found while testing #607. On Android, changing the skip forward or back
time in Settings → Playback updated the player's button labels straight
away, but the actual skips kept the old amounts until the app restarted.
ExoPlayer took its seek increments once, from the builder, when the
player was created.

## What changed
- `ExoPlayerAudioPlayer` collects `observeForwardTimeMs()` and
`observeBackwardTimeMs()` in its main-thread scope, and pushes changes
into ExoPlayer's runtime `setSeekForwardIncrementMs` /
`setSeekBackIncrementMs` (added in Media3 1.11).
- That covers the in-app buttons, the media notification and other
media-session controls.
  - Desktop and iOS already read the skip times on every skip.
- A changelog entry under Fixed.

## Verification
- `./scripts/ktlint --check` passes,
`:app:android:compileAlphaDebugKotlin` compiles, and
`:infra:audioplayer:impl:jvmTest` passes.
- **On device:** the same change was verified on the emulator in the
closed #1198, in one app session without restarting. Each change took
effect on the next skip, whether from the in-app buttons, `cmd
media_session dispatch fast-forward` / `rewind`, or the notification
buttons:

| Skip times (forward / back) | Result |
|---|---|
| 30s / 10s (unchanged) | +30s / −10s |
| changed to 5s / 30s | +5s / −30s |
| changed to 10s / 5s | +10s / −5s |

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants