media icon indicating copy to clipboard operation
media copied to clipboard

[Google DAI + HLS] Playback is crashed at the ImaServerSideAdInsertionMediaSource

Open devno44 opened this issue 1 year ago • 7 comments

Version

Media3 1.3.1

More version details

No response

Devices that reproduce the issue

All devices

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

  1. Play the SSAI content (Google DAI + HLS protocol)
  2. While playing the content, when the Ad is played App is crashed.

Expected result

App is not crashed

Actual result

Playback crashes with the following stack trace:

Process: com.xx.qa, PID: 14899 java.lang.IllegalArgumentException
      at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:40)
      at androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource.setAdPlaybackStates(ServerSideAdInsertionMediaSource.java:179)
      at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.invalidateServerSideAdInsertionAdPlaybackState(ImaServerSideAdInsertionMediaSource.java:790)
      at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.setAdPlaybackState(ImaServerSideAdInsertionMediaSource.java:749)
      at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.access$2300(ImaServerSideAdInsertionMediaSource.java:116)
      at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$SinglePeriodLiveAdEventListener.onAdEvent(ImaServerSideAdInsertionMediaSource.java:1491)
      at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$ComponentListener.onAdEvent(ImaServerSideAdInsertionMediaSource.java:1017)
      at com.google.ads.interactivemedia.v3.impl.zzab.zzb(com.google.ads.interactivemedia.v3:interactivemedia@@3.31.0:25)
      at com.google.ads.interactivemedia.v3.impl.zzbr.zzb(com.google.ads.interactivemedia.v3:interactivemedia@@3.31.0:12)
      at com.google.ads.interactivemedia.v3.impl.zzau.zzl(com.google.ads.interactivemedia.v3:interactivemedia@@3.31.0:50)
      at com.google.ads.interactivemedia.v3.impl.zzbb.zzf(com.google.ads.interactivemedia.v3:interactivemedia@@3.31.0:7)
      at com.google.ads.interactivemedia.v3.impl.zzax.onPostMessage(com.google.ads.interactivemedia.v3:interactivemedia@@3.31.0:2)
      at androidx.webkit.internal.WebMessageListenerAdapter.onPostMessage(WebMessageListenerAdapter.java:55)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil$InvocationHandlerWithDelegateGetter.invoke(BoundaryInterfaceReflectionUtil.java:162)
      at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
      at $Proxy13.onPostMessage(Unknown Source)
      at WV.sR.a(chromium-TrichromeWebViewGoogle.aab-stable-647807130:77)
      at WV.hY.run(chromium-TrichromeWebViewGoogle.aab-stable-647807130:28)
      at android.os.Handler.handleCallback(Handler.java:938)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loopOnce(Looper.java:201)
      at android.os.Looper.loop(Looper.java:288)
      at android.app.ActivityThread.main(ActivityThread.java:7839)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Media

Not applicable

Bug Report

  • [ ] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

devno44 avatar Jul 02 '24 00:07 devno44

This error doesn't happen all the time, it only happens occasionally when the Ad is played, and will probably be difficult to reproduce. Therefore, is there any way to avoid the app crashing after this error occurs? For example, using try-catch?

devno44 avatar Jul 02 '24 00:07 devno44

Can you provide us with an assetKey to test and repro with?

marcbaechinger avatar Jul 02 '24 08:07 marcbaechinger

@marcbaechinger Like I said before, I'm not sure how it's reproduced, it doesn't happen often, it happens occasionally, and it's not always reproducible. This crash is also reported a lot on firebase from our users, but we don't know how to investigate what the cause is.

devno44 avatar Jul 03 '24 00:07 devno44

Thanks for your response. I understand it doesn't repro easily but without having a stream that is producing the problem, it is hard for me to do something.

An assetKey of a stream that produces the problem would make this issue actionable for me. If you're unable to share test content publicly, please send them to [email protected] using a subject in the format "Issue #1520". Please also update this issue to indicate you’ve done this.

marcbaechinger avatar Jul 03 '24 09:07 marcbaechinger

@marcbaechinger Thank you, I will discuss with my team about creating a content for testing. But before that, is there any solution that can avoid that error? At least it won't cause the app to crash ?

devno44 avatar Jul 11 '24 01:07 devno44

Therefore, is there any way to avoid the app crashing after this error occurs? For example, using try-catch?

I don't think so. The assertion is set at the place where the problem starts. If we catch it there, it would crash some later without us knowing exactly where it started.

We'll look into this when we have the media.

marcbaechinger avatar Jul 11 '24 07:07 marcbaechinger

I have this problem since 2 days after something upgraded in my device. All apps that use rewarded ads crash for me. Will post a logcat after it happens again.

alpha4041 avatar Aug 02 '24 00:08 alpha4041