isPlayingAd value change is delayed sometimes for midroll ads
Open
@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
popUpToto that screen; and when we return to player, we dopopBackStackto 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:
- Play a video with ads.
- After the preroll is finished. Click the "settings" button on player to go to a new screen.
- 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)
- After returning to player, let the playback continue, until it reaches mid-roll.
- 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()fromAdEventListenerdoesn't give us events such as - STARTED, AD_BUFFERING, AD_PROGRESS, when the ad is playing but whenisPlayingAdis 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 bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.