androidx / androidx/media

isPlayingAd value change is delayed sometimes for midroll ads

Open
#745 12 comments 0 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Oct 20, 2023.

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

Description

Version

Media3 1.1.1

More version details

Issue reproduced on

  • 1.2.0-alpha02
  • 1.1.1
  • 1.0.2
Devices that reproduce the issue

Google TV Chromcast and Android mobile devices

Devices that do not reproduce the issue

N/A

Reproducible in the demo app?

Yes. Please see comment below.

Reproduction steps

Notes:

  • We have a "settings" button on player, and by clicking it, we can open certain screen, and can then return to the player.
  • When we open a screen from player, we do popUpTo to that screen; and when we return to player, we do popBackStack to go back to player.
  • We use IMA SDK to integrate ads into video.
  • We have an Android TV app and Android mobile app, providing the same on-demand video streaming service. Two apps are different code bases, but the player codes are shared.

Steps:

  1. Play a video with ads.
  2. After the preroll is finished. Click the "settings" button on player to go to a new screen.
  3. Do nothing on this new screen, and return to player by pressing "back" button on TV remote. (this can also be an equivalent "back" action on mobile device)
  4. After returning to player, let the playback continue, until it reaches mid-roll.
  5. When mid-roll starts playing, observe if the ad controls, and countdown times show up correctly.
Expected result

The ad controls, and countdown times show up correctly.

Actual result
  • We see the first ad in the mid-roll starts, but the ad controls don't show up yet (for the first 5-8 secs).
  • We see boolean isPlayingAd() is still false when the ad starts playing. It will change to true later, but after the ad is playing for 5-8 seconds.
  • We also see onAdEvent() from AdEventListener doesn't give us events such as - STARTED, AD_BUFFERING, AD_PROGRESS, when the ad is playing but when isPlayingAd is false.
Media

N/A

(Think it doesn't depend on media, but can revisit)

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

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.