androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.73k stars 415 forks source link

Support client-side ads in DASH multi period #1642

Open dejan-korchev-deltatre opened 3 months ago

dejan-korchev-deltatre commented 3 months ago

Hello,

We having a case where we set Client-side Ads on DASH Multi period video, but video stop after add and we receive the error.

If possible, can you provide an example for the right implementation or some kind of help?

The version of ExoPlayer that I am using is Media3 1.4.0 Thank you

Custom Test Case:

> {
  "name": "Client-side Ads on DASH Multi period video",
  "uri": "https://dash.akamaized.net/dash264/TestCases/5a/nomor/1.mpd",
  "ad_tag_uri": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="
}

Error:

Caused by: java.lang.IllegalArgumentException
                                                                                                          at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:40)
                                                                                                          at androidx.media3.exoplayer.source.ads.AdsMediaSource.onChildSourceInfoRefreshed(AdsMediaSource.java:289)
                                                                                                          at androidx.media3.exoplayer.source.ads.AdsMediaSource.onChildSourceInfoRefreshed(AdsMediaSource.java:63)
                                                                                                          at androidx.media3.exoplayer.source.CompositeMediaSource.lambda$prepareChildSource$0$androidx-media3-exoplayer-source-CompositeMediaSource(CompositeMediaSource.java:117)
                                                                                                          at androidx.media3.exoplayer.source.CompositeMediaSource$$ExternalSyntheticLambda0.onSourceInfoRefreshed(D8$$SyntheticClass:0)
                                                                                                          at androidx.media3.exoplayer.source.BaseMediaSource.refreshSourceInfo(BaseMediaSource.java:90)
                                                                                                          at androidx.media3.exoplayer.source.MaskingMediaSource.onChildSourceInfoRefreshed(MaskingMediaSource.java:211)
                                                                                                          at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed(WrappingMediaSource.java:154)
                                                                                                          at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed(WrappingMediaSource.java:49)
                                                                                                          at androidx.media3.exoplayer.source.CompositeMediaSource.lambda$prepareChildSource$0$androidx-media3-exoplayer-source-CompositeMediaSource(CompositeMediaSource.java:117)
                                                                                                          at androidx.media3.exoplayer.source.CompositeMediaSource$$ExternalSyntheticLambda0.onSourceInfoRefreshed(D8$$SyntheticClass:0)
                                                                                                          at androidx.media3.exoplayer.source.BaseMediaSource.refreshSourceInfo(BaseMediaSource.java:90)
                                                                                                          at androidx.media3.exoplayer.dash.DashMediaSource.processManifest(DashMediaSource.java:937)
                                                                                                          at androidx.media3.exoplayer.dash.DashMediaSource.onManifestLoadCompleted(DashMediaSource.java:718)
                                                                                                          at androidx.media3.exoplayer.dash.DashMediaSource$ManifestCallback.onLoadCompleted(DashMediaSource.java:1395)
                                                                                                          at androidx.media3.exoplayer.dash.DashMediaSource$ManifestCallback.onLoadCompleted(DashMediaSource.java:1390)
tonihei commented 3 months ago

Client-side ad insertion in multi-period DASH streams is not yet supported I'm afraid. There is an existing issue in https://github.com/google/ExoPlayer/issues/3693 to track this enhancement. I'll close the other one to move the request over to the Media3 issue tracker (and also because the other issue mixed multiple things together that have since been addressed).