Commit 47561f20 by andrewlewis Committed by Oliver Woodman

Fix handling of incompatible VPAID ads

Issue: #7832
PiperOrigin-RevId: 329497598
parent d155416c
...@@ -322,6 +322,8 @@ ...@@ -322,6 +322,8 @@
* Add `ImaAdsLoader.Builder.setCompanionAdSlots` so it's possible to set * Add `ImaAdsLoader.Builder.setCompanionAdSlots` so it's possible to set
companion ad slots without accessing the `AdDisplayContainer`. companion ad slots without accessing the `AdDisplayContainer`.
* Add missing notification of `VideoAdPlayerCallback.onLoaded`. * Add missing notification of `VideoAdPlayerCallback.onLoaded`.
* Fix handling of incompatible VPAID ads
([#7832](https://github.com/google/ExoPlayer/issues/7832)).
* Demo app: * Demo app:
* Replace the `extensions` variant with `decoderExtensions` and update the * Replace the `extensions` variant with `decoderExtensions` and update the
demo app use the Cronet and IMA extensions by default. demo app use the Cronet and IMA extensions by default.
......
...@@ -1096,6 +1096,11 @@ public final class ImaAdsLoader ...@@ -1096,6 +1096,11 @@ public final class ImaAdsLoader
if (imaAdInfo != null) { if (imaAdInfo != null) {
adPlaybackState = adPlaybackState.withSkippedAdGroup(imaAdInfo.adGroupIndex); adPlaybackState = adPlaybackState.withSkippedAdGroup(imaAdInfo.adGroupIndex);
updateAdPlaybackState(); updateAdPlaybackState();
} else if (adPlaybackState.adGroupCount == 1 && adPlaybackState.adGroupTimesUs[0] == 0) {
// For incompatible VPAID ads with one preroll, content is resumed immediately. In this case
// we haven't received ad info (the ad never loaded), but there is only one ad group to skip.
adPlaybackState = adPlaybackState.withSkippedAdGroup(/* adGroupIndex= */ 0);
updateAdPlaybackState();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment