Is it possible to have a DynamicConcatenatingMediaSource with multiple AdsMediaSource on this?
Example of one case:
mediaSource1 and mediaSource2 requesting AdsMediaSource for each media source, concatenate the results and then play :
val concatenatedSource = ConcatenatingMediaSource(mediaSource1 , mediaSource2);
dynamicMediaSource.addMediaSource(concatenatedSource)
player?.prepare(dynamicMediaSource, false, false)
When I tried without the AdsMediaSource, it works fine. But when i tried to add AdsMediaSource for each one and concatenate this i got a nullpointer.
Just want to know if this is possible and if yes, please provide a example of how to handle multiple ads with playlist.
Thank you!
This is not possible at the moment, because AdsMediaSource asserts it is the top level source used to configure the player. You can't compose it with other media sources as ImaAdsLoader's logic makes assumptions about the player timeline when it handles player events, and these assumptions may be incorrect if the player is actually playing a concatenation.
I'll mark this as an enhancement to allow composition of AdsMediaSources, which will involve making ImaAdsLoader work with multi-period timelines. We'd need to decide whether to allow having just one ImaAdsLoader shared by all the AdsMediaSources in the concatenation (it would request each successive ad tag at the earliest time and the app wouldn't have to take care of creating/releasing multiple ad loaders). #3693 tracks a related enhancement, to support inserting ads in content that has a multi-period timeline.
Thanks @andrewlewis ! And for now, you know a way to workaround this? maybe I can workaround this by creating the playlist manually without the DynamicConcatenatingMediaSource and requesting ima for each video of the list on the moment before the player start one by one?
Yes. You can just play each AdsMediaSource separately, one at a time (re-preparing the player a new source each time the preceding playback transitions to the ended state). This has the disadvantage that the player can't pre-buffer the next source, so the transitions won't be seamless, and of course will add some complexity to your app for managing switching from one source to the next.
Makes sense, this seamless transition is awesome! Hope to have this soon. Thanks to mark as enhancement
Hi, @andrewlewis, are there any updates on this one? Any idea of when this functionality could be released?
Thanks!
No updates, I'm afraid. At the moment we aren't planning to look at this soon, but if anyone else is waiting for the feature please leave a comment so we can prioritize based on demand. Thanks!
I'm a dev working for a major media corporation... this would be a great feature for us
Hi,
In Brightcove sdk , we can add a playlist and a single ad URL to BrightcoveExoPlayerVideoView. But that ad will play with each video in the playlist. So is there any similar solution with Exoplayer.
We don't have any updates yet I'm afraid. The recommended approach for now is for apps to change the player's source each time a playlist items finishes playing. #3636 describes how to pre-load ads, which may help reduce the delay when starting to play a new playlist item.
I'm a dev working for a major media corporation... this would be a great feature for us as well.
I am keen on this too!
+1
Would also love to get this feature!
Hi @andrewlewis, sorry to bother again, but are there any updates on this one? It seems like a lot of people are interested.
I work for a big company and this is a really big deal for us. If this feature isn't going to be implemented soon I will have to apply the hard workaround you described above.
Still no updates I'm afraid. Understood that this is a desired feature. I'll take another look at how long this would take to implement soon, but please don't plan on it being addressed this quarter.
Thanks a bunch for that @andrewlewis. It is open source, so you shouldn't feel obligated to implement it. It is still nice to know that you guys can get it in at some point :)
It would be great if anyone who would like to use this feature could email dev.[email protected] with subject "Issue #3750" and provide a bit more detail on their app and use case. Thanks!
I am very interested in this feature.
@andrewlewis hi, any updates?
@gengar3 No updates I'm afraid.
Yes, we are very much interested in this feature. As this feature will help us in the promotion of our pack and this will impact business. We are eagerly waiting for this feature, if it's not gonna fix any time soon then it would be very much workaround to be implemented on the app side. So, please keep on updating the status.
Everyday this topic cames from our company meetings! I hope google team try to do the best to have this year!! This is something very important, the workaround is terrible
Yes, this is something that comes up at least once a week in my company too... It's something that we would be really glad to have.
I'm surprised it is taking so long to release this feature.
We've planned some time to look at this over the next couple of months, but can't provide any guarantees.
I'm also facing this crash issue on exo 2.9.4
java.lang.IllegalArgumentException
at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
at com.google.android.exoplayer2.source.CompositeMediaSource.prepareChildSource(CompositeMediaSource.java:102)
at com.google.android.exoplayer2.source.ConcatenatingMediaSource.addMediaSourceInternal(ConcatenatingMediaSource.java:667)
at com.google.android.exoplayer2.source.ConcatenatingMediaSource.addMediaSourcesInternal(ConcatenatingMediaSource.java:643)
at com.google.android.exoplayer2.source.ConcatenatingMediaSource.handleMessage(ConcatenatingMediaSource.java:564)
at com.google.android.exoplayer2.source.ConcatenatingMediaSource.lambda$fl0myfoK2raBckmHYwV9YTd0eeo(Unknown Source:0)
at com.google.android.exoplayer2.source.-$$Lambda$ConcatenatingMediaSource$fl0myfoK2raBckmHYwV9YTd0eeo.handleMessage(Unknown Source:2)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
It happened randomly.
@andrewlewis Saw your comment from February that you guys were planning time around this, have you guys made any definitive plans on implementation?
+1 I am also interested.
This would be wonderful for us as well.
I'm waiting for this feature... I Hope it will release as soon as possible. because in playlist mode , we have requirement every episode has different ads.
+1
Has anybody successfully worked around this limitation?
@andrewlewis Any update on this feature.We also need this.I would be great if you guys take it as priority task
+1 for this feature, please.
+1
+1
I need this to eventually insert ads in between audio playback items.
You could at least warn developers about this. The documentation of AdsMediaSource just tells us that it can't be put into a ConcatenatingMediaSource, but there is no hint that you can't put a ConcatenatingMediaSource _into_ it.
Any update? This is pretty essential, however, this is not solved yet for a long time.
We lost thousands of clients from the last couple of months and now we're going to put down Exoplayer if you don't have the update for this.
Hopefully, you can solve this within a few days.
Thanks.
I'm working on it at the moment.
Hi, Andres, I tested IMA extension with test ad tags,
how can I get the real ad tags?
Hi @andrewlewis , Thanks for enriching Exoplayer. It would be great to know by when will this feature be added.
Thanks.
This is implemented on the development branch and should be in the next major release 2.13.
Most helpful comment
I'm working on it at the moment.