androidx / androidx/media

Android Auto: onPositionDiscontinuity called when user selected same chapter

Open
#2,244 3 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Mar 18, 2025.

question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Hello! I'm trying to figure out how to fix a problem on Android Auto where if a user has a chapter already running and halfway through it, the user opens the chapter list and selects the same chapter, the listening progress resets to 0.

override fun onPositionDiscontinuity(
    oldPosition: Player.PositionInfo, // positionMs not 0
    newPosition: Player.PositionInfo, // positionMs is 0
    reason: Int,
) {
    if (reason == Player.DISCONTINUITY_REASON_SEEK) {
        updateBookmark()
    }
}

This callback is called from Player and I can't fix the reset positions.
Is this a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.