-
Notifications
You must be signed in to change notification settings - Fork 575
Description
Version
Media3 main branch
More version details
commit ec6ac47 (upstream/main, stevem/main, stevem/HEAD, main)
Author: tianyifeng tianyifeng@google.com
Date: Tue Jul 22 10:43:21 2025 -0700
Devices that reproduce the issue
I reproduced on an SEI AmLogic Android TV device, however most any device should see the same issue.
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Play the sample media.exolist.json items I will email to the developers. The use cases are, pre-roll ad with:
- Content that fails immediately after preparation (missing DRM key is an easy one)
- Stock android video in the examples, with an VAST tag containing an ad that fails during playback (easy way is a 404 on a segment). Either single ad or one of a pod.
Expected result
- Content errors should not affect ad playback.
- Ads should be allowed to complete cleanly if they are functioning.
- A single failed ad in a pod should be skipped.
- If an ad fails, playback should fall back to content.
Actual result
- Ads that were playing successfully are incorrectly marked as failed (
AD_STATE_ERROR
) - Ads are never finalized as completed (remain in
AD_STATE_PAUSED
) - A failed ad is not skipped within a pod
- Failed ads do not fall back to content playback
Detailed Description
The change introduced in commit 7cf2fd9
attempted to fix premature error dispatch during ad playback by delaying onPlayerError()
handling until after the Listner.onEvents()
cycle completed.
When an error occurs during content preparation while an ad is still playing, ExoPlayer cannot correctly attribute the error to the content source. Instead, the error bubbles up through ExoPlayerImplInternal.stopInternal()
and causes the entire CompositeMediaSource (AdsMediaSource + content) to be torn down.
This results in the ImaAdsLoader
being stopped prematurely — even when the ad is not at fault — and breaks proper ad lifecycle handling.
User-Facing Issues
- The ad is incorrectly marked as failed
A content preparation error is misattributed to the currently playing ad, resulting in an invalidAD_STATE_ERROR
. - The ad is never marked as completed
Even thoughALL_ADS_COMPLETED
is dispatched by IMA, the player is torn down before ExoPlayer updatesAdPlaybackState
to reflect completion. - A single failing ad in a pod is not skipped
If one ad in a pod fails (e.g., due to a 404 or DRM error), the player stops entirely instead of skipping to the next ad in the group. - A failing ad does not fall back to content
When an ad fails, the player should skip to content. Instead, the entire playback pipeline is torn down viastopInternal()
.
Media
Either construct yourself with the guidance above or look to the info email I will send,
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.