Skip to content

Conversation

sandymist
Copy link
Contributor

Issue

When a user seeks from the app player UI all works fine, however, if the same is done from outside app, such as Notification player, Android Auto, etc. the playback jumps to a position in one of the earlier chapters.

Solution

After researching different options, found that there is no way to communicate to the player that the seek is from the notification player. This information is needed because, the seek from the app UI is with reference to beginning of the audio content (absolute) where as the media session associated with foreground notification player is relative to the current chapter. This fix injects this information by adding a constant shift value to the seek position originating from the app and the media session seekTo() callback uses this to distinguish between app originated and notification player originated seek.

The arbitrary shift used is long enough to cover any play duration, unless there is a audio that plays for two months uninterrupted!

Testing

Tested

  • Seeks from app player UI, table of contents, bookmarks
  • Seeks from notification player controls
  • Android auto

@kschults kschults self-assigned this Nov 16, 2023
@BarryFruitman BarryFruitman self-requested a review November 16, 2023 22:00
@BarryFruitman BarryFruitman self-assigned this Nov 16, 2023
@sandymist sandymist merged commit f1484ca into scribd:main Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants