androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Apache License 2.0
1.37k stars 324 forks source link

Ad events (AD_START, AD_BREAK, AD_STOP..etc) is not fired with Google DAI + DASH #1521

Open devno44 opened 6 days ago

devno44 commented 6 days ago

Like I said in the title, When I tried Google DAI + DASH, everything seemed fine, but Ad events (AD_START, AD_BREAK, AD_STOP..etc) were not fired. Ad events work fine when I use Google DAI + HLS. So the question here is Google DAI + DASH is still not fully supported or is this a bug?

marcbaechinger commented 6 days ago

It's a bit unclear what you are doing from your report.

I assume with Google DAI you are referring to ImaServerSideAdInsertionMediaSource for which you register an AdEventListener.

The ad event listener is from the SDK and the ExoPlayer extension does not intercept any ad events. The listener is registered on the stream manager after the assetKey or contentId is resolved by the SDK.

If you don't get events,. then the SDK is not sending them.

When you use the SDK directly, do you see these events for DASH?

If you are indeed using ImaServerSideAdInsertionMediaSource, then you can listen to player events also. You see a Listener.onPositionDiscontinuity() when each period starts and aned. This is true for ad periods in the same way and you can get the information about which ad is currently being played from the PositionInfo that gives you adGroupIndex and adIndexInAdGroup as well as the position of the discontinuity in the stream.

If this isn't sufficient for you and you want the SDK events, then we can't help unless you see these events when using the SDK directly which isn't really likely because we do not intercept any events coming from the SDK.