androidx / androidx/media

When is the right moment to call AdPlaybackState.withPlayedAd

Open
#2,441 1 comment 1 reaction 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since May 19, 2025.

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

Description

We noticed that if we don't call AdPlaybackState.withPlayedAd after an ad is finished the same ad loops forever. Is this expected?

Right now we call that after ExoPlayer.Listener.onTimelineChanged and ExoPlayer.Listener.onPositionDiscontinuity in case if reason is Player.DISCONTINUITY_REASON_AUTO_TRANSITION or newPosition.adIndexInAdGroup has changed, is that correct?

I'm asking this because we are reported that in some cases the same ad starts looping endlessly, and our best guess is that withPlayedAd call time is the culprit here...

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.