Player crash while scrub through ads
Play a video for VMAP pre-roll single ad, mid-roll standard pods with 5 ads every 10 seconds
let the pre-roll play, now scrub through 5th mid-roll and let a mid roll will play.
Now scrub before 2nd mid-roll and app will crash with,
2020-06-11 14:42:28.717 13004-13004/com.google.android.exoplayer2.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.exoplayer2.demo, PID: 13004
java.lang.IllegalStateException
at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:81)
at com.google.android.exoplayer2.ext.ima.ImaAdsLoader.stopAd(ImaAdsLoader.java:944)
at com.google.ads.interactivemedia.v3.internal.akf.a(IMASDK:24)
at com.google.ads.interactivemedia.v3.internal.akb.a(IMASDK:177)
at com.google.ads.interactivemedia.v3.internal.akb.a(IMASDK:44)
at com.google.ads.interactivemedia.v3.internal.ake.b(IMASDK:28)
at com.google.ads.interactivemedia.v3.internal.akc.shouldOverrideUrlLoading(IMASDK:6)
at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:73)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-Monochrome.aab-stable-410410170:16)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Also sometime time content just stuck after ad is done, and log says ad is in progress but it is actually done, player is not able to switch from IMA.
Reproducible on sample app
bugreport-NPD26.48-24-1-2020-06-11-14-30-51.zip
2.11.5
Bug report is from Motorola X play OS 7.1.1
but happens on Emulator API 21 and above (did not check older APIs)
There seem to be two (likely related) issues to do with preloading and seeking:
pauseAd/stopAd called for that ad pod. I think this is unexpected because playAd was never called for the ad.I've filed [Internal: b/159111848] to ask the IMA SDK team to take a look at this.
In the short term, 5a88e0bc1d37b8cd16f993ae51ebe17fa9358ab9 should avoid crashing for this case, and I'll plan to make another commit that will not treat this as an unexpected failure (to avoid discarding all ads) for (1). To address (2) I'll mark the preloaded ad as skipped at the moment when stopAd is unexpectedly called.
Fixed in the commits referenced above. This will be part of 2.11.6, which should be released today or tomorrow.
Most helpful comment
Fixed in the commits referenced above. This will be part of 2.11.6, which should be released today or tomorrow.