Skip to content

Add rewind after interruptions setting - #4788

Open
mpgirro wants to merge 2 commits into
Automattic:trunkfrom
mpgirro:feature/rewind-after-interruptions
Open

Add rewind after interruptions setting#4788
mpgirro wants to merge 2 commits into
Automattic:trunkfrom
mpgirro:feature/rewind-after-interruptions

Conversation

@mpgirro

@mpgirro mpgirro commented Jul 19, 2026

Copy link
Copy Markdown

This PR adds an optional "Rewind after interruptions" setting: when playback resumes after an audio interruption (phone call, alarm, Siri, CarPlay navigation prompt or another app taking over audio), Pocket Casts seeks back a configurable number of seconds so listeners don't lose context. This is especially useful in the car, where navigation prompts regularly interrupt playback. A matching PR with identical behavior is open for Android: Automattic/pocket-casts-android#5611.

Behavior

  • New picker in Settings > General, directly below Intelligent Playback Resumption: Off, 5, 10, 15, 30, 60 seconds (default: 5 seconds once the feature flag is enabled).
  • Rewind applies on both automatic resume (system .shouldResume) and manual resume after an interruption-caused pause.
  • When Intelligent Playback Resumption would also rewind the same resume, the larger amount wins - the two never stack.
  • Interruptions while already paused, route disconnections (headphone unplug) and ducking don't trigger it; the rewind clamps at 0:00.
  • CarPlay inherits the behavior automatically via the shared playback engine.
  • Behind the new interruptionRewind feature flag (default: debug builds only). The setting is device-local; adding it to named-settings sync would need a server-side key and is left as a possible follow-up for maintainers.

Implementation notes

  • The interruption handler now records the frozen playback position and cancels the progress timer before storing the pause state - without this, the 1-second progress timer kept moving playedUpTo during the interruption and PlaybackCatchUpHelper's position guard rejected the adjustment on resume. This also benefits the existing Intelligent Playback Resumption after interruptions.
  • PlaybackCatchUpHelper now computes the pause-length ladder and the interruption rewind separately and applies max() of the two.

To test

  1. Run a debug build (flag interruptionRewind is enabled by default there) and start playing an episode.
  2. Go to Settings > General > Rewind after interruptions and pick e.g. 30 seconds.
  3. Trigger an interruption while playing: easiest is setting a timer/alarm that fires, or receiving a phone call.
  4. When the alarm is dismissed / call ends, playback resumes automatically and starts ~30 seconds before the interruption point.
  5. For a long interruption where iOS doesn't auto-resume: press play manually - the rewind still applies.
  6. Set the setting to Off and verify resume happens exactly where playback stopped (for pauses shorter than 5 minutes).
  7. Verify no stacking: with interruption rewind 60s, interrupt for >5 minutes, resume - playback rewinds 60s (not 70s). A manual pause of >5 minutes still gets the unchanged Intelligent Playback Resumption rewind (10s).
  8. Verify a manual pause or unplugging headphones followed by resume does not trigger the interruption rewind.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics. Maintainer action needed: this PR adds the settingsGeneralInterruptionRewindChanged event (value property = chosen seconds); I can't edit the schema repo as an external contributor.

Rewinds playback by a configurable number of seconds (off, 5-60s,
default 5s) when it resumes after an audio interruption such as a
call, alarm or navigation prompt. When both this and intelligent
playback resumption would rewind the same resume, the larger amount
wins so they never stack.

Behind the interruptionRewind feature flag. Device-local setting,
not synced.
@mpgirro
mpgirro requested a review from a team as a code owner July 19, 2026 09:43
@mpgirro
mpgirro requested review from kean and removed request for a team July 19, 2026 09:43
@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dcamozzi

Copy link
Copy Markdown
Contributor

Thanks for the suggestion and for taking the time to put together a PR. We've discussed it with the team and, at least for now, we don't plan to add a separate interruption rewind setting.

We appreciate the effort and will keep the feedback in mind as we continue to improve the listening experience.

@kean
kean removed their request for review July 29, 2026 19:08
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.

3 participants