Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video player crash when scrubbing through mid-roll #7492

Closed
nishantkp opened this issue Jun 11, 2020 · 2 comments
Closed

Video player crash when scrubbing through mid-roll #7492

nishantkp opened this issue Jun 11, 2020 · 2 comments
Assignees
Labels

Comments

@nishantkp
Copy link

Issue description

Player crash while scrub through ads

Reproduction steps

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.

Link to test content

Reproducible on sample app

A full bug report captured from the device

bugreport-NPD26.48-24-1-2020-06-11-14-30-51.zip

Version of ExoPlayer being used

2.11.5

Device(s) and version(s) of Android being used

Bug report is from Motorola X play OS 7.1.1
but happens on Emulator API 21 and above (did not check older APIs)

ojw28 pushed a commit that referenced this issue Jun 12, 2020
Some but not all VideoAdPlayer callbacks from the IMA SDK included
defensive handling of unexpected cases. Add the remaining ones.

Issue: #7492
PiperOrigin-RevId: 316082651
@andrewlewis
Copy link
Collaborator

There seem to be two (likely related) issues to do with preloading and seeking:

  1. After an ad pod coming up has preloaded, if the user seeks before it plays we get pauseAd/stopAd called for that ad pod. I think this is unexpected because playAd was never called for the ad.
  2. If the user seeks back, the ad pod never loads again.

I've filed [Internal: b/159111848] to ask the IMA SDK team to take a look at this.

In the short term, 5a88e0b 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.

andrewlewis added a commit that referenced this issue Jun 17, 2020
After an ad pod coming up has preloaded, if the user seeks before it
plays we get pauseAd/stopAd called for that ad pod. Also, the ad will
not load again. Work around this unexpected behavior by handling
pauseAd/stopAd and discarding the ad.

In future, it's likely that the IMA SDK will stop calling those
methods, and will loadAd again for the preloaded ad that was
unexpectedly discarded. This change should be compatible with that,
because the ad won't be discarded any more due to not calling stopAd.

Issue: #7492
PiperOrigin-RevId: 316873699
ojw28 pushed a commit that referenced this issue Jun 17, 2020
Some but not all VideoAdPlayer callbacks from the IMA SDK included
defensive handling of unexpected cases. Add the remaining ones.

Issue: #7492
PiperOrigin-RevId: 316082651
ojw28 pushed a commit that referenced this issue Jun 17, 2020
After an ad pod coming up has preloaded, if the user seeks before it
plays we get pauseAd/stopAd called for that ad pod. Also, the ad will
not load again. Work around this unexpected behavior by handling
pauseAd/stopAd and discarding the ad.

In future, it's likely that the IMA SDK will stop calling those
methods, and will loadAd again for the preloaded ad that was
unexpectedly discarded. This change should be compatible with that,
because the ad won't be discarded any more due to not calling stopAd.

Issue: #7492
PiperOrigin-RevId: 316873699
@ojw28
Copy link
Contributor

ojw28 commented Jun 23, 2020

Fixed in the commits referenced above. This will be part of 2.11.6, which should be released today or tomorrow.

@ojw28 ojw28 closed this as completed Jun 23, 2020
@google google locked and limited conversation to collaborators Aug 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants