ImaServerSideAdInsertionMediaSource hangs forever when the IMA SDK never calls back requestStream() (regression since interactivemedia 3.39.0 / media3 1.10.0)
@marcbaechinger is already working on this.
Since Jul 15, 2026.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.10.0
More version details
No response
Devices that reproduce the issue
iPhone 13
Android 12 - Samsung S23
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Configure content with DAI (ImaServerSideAdInsertionMediaSource) using media3 1.10.0+.
Play back repeatedly (the failure is intermittent and depends on the IMA SDK/ad server's behavior, not fully deterministic).
When the IMA SDK fails to invoke any callback for the stream request, the player hangs on black indefinitely.
1.9.4 (works) vs 1.10.0 / 1.10.1 (broken)
Transitive dependency com.google.ads.interactivemedia.v3:interactivemedia: 3.38.0 on 1.9.4 → 3.39.0 on 1.10.0+ (confirmed via git show :libraries/exoplayer_ima/build.gradle)
Consumed through a fork of react-native-video
Reproducible on multiple Android devices, intermittently
Affects both DAI (server-side) and VAST (client-side) ads; this report focuses on the DAI path, which is the one that could be fully diagnosed with thread dumps
(Fill in: device models, Android/API levels, exact media3-exoplayer-ima version, and whether this also reproduces without the react-native-video fork, directly against plain ExoPlayer/media3)
Expected result
If the IMA stream request fails or never responds, ImaServerSideAdInsertionMediaSource should report an error in a timely manner (or retry), allowing the app to react (e.g. by falling back to ad-free content).
Actual result
In libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java, the inner class StreamManagerLoadable does the following inside load():
javaadsLoader.requestStream(request);
conditionVariable.block(); // no timeout
conditionVariable is only released once the IMA SDK invokes some callback (success or error) for that stream request. It was confirmed (via two independent adb bugreport captures, taken during separate failure sessions) that IMA SDK 3.39.0 can, intermittently, invoke no callback at all — neither success nor error — for requestStream(). Since conditionVariable.block() has no timeout, the ExoPlayer:Loader:ImaServerSideAdInsertionMediaSource thread ends up blocked indefinitely at:
ImaServerSideAdInsertionMediaSource.java:1195 (StreamManagerLoadable.load(), conditionVariable.block())
Because no content URI is ever resolved and no Timeline/MediaPeriod is ever created, there is also no mechanism for maybeThrowSourceInfoRefreshError() to surface the problem — that method is only polled via MaskingMediaPeriod.maybeThrowPrepareError() once a MediaPeriod already exists, which never happens in this scenario. Net result: the player is stuck on a black screen, with no ExoPlaybackException/onPlayerError, and no log output at all.
Media
Not applicable - DRM protected
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.