mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove pending adLoad timeout tasks when resuming content
When a timeline change occurs, the `AdTagLoader` will post an adLoad timeout task if currently waiting for an ad to load. Once sdk calls `loadAd`, any pending timeout tasks are removed. If the timeout occurs, the ad group is canceled and content will resume. If the SDK proceeded to resume content without calling `loadAd`, then any pending timeout tasks should be removed or else a future ad group may error due to a previous timeout task. PiperOrigin-RevId: 723442852
This commit is contained in:
parent
97a1d31b5d
commit
4c163553e7
@ -797,7 +797,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
private void resumeContentInternal() {
|
private void resumeContentInternal() {
|
||||||
if (imaAdInfo != null) {
|
if (imaAdInfo != null) {
|
||||||
adPlaybackState = adPlaybackState.withSkippedAdGroup(imaAdInfo.adGroupIndex);
|
// Remove any pending timeout tasks as CONTENT_RESUME_REQUESTED may occur instead of loadAd.
|
||||||
|
// See [Internal: b/330750756].
|
||||||
|
handler.removeCallbacks(adLoadTimeoutRunnable);
|
||||||
|
adPlaybackState = adPlaybackState.withSkippedAdGroup(checkNotNull(imaAdInfo).adGroupIndex);
|
||||||
updateAdPlaybackState();
|
updateAdPlaybackState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user