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

Add support for concatenation of AdsMediaSources #3750

Closed
priscila225 opened this issue Jan 25, 2018 · 40 comments
Closed

Add support for concatenation of AdsMediaSources #3750

priscila225 opened this issue Jan 25, 2018 · 40 comments
Assignees

Comments

@priscila225
Copy link

priscila225 commented Jan 25, 2018

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!

@andrewlewis andrewlewis self-assigned this Jan 25, 2018
@andrewlewis
Copy link
Collaborator

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.

@andrewlewis andrewlewis changed the title How to add multiple AdsMediaSource on a playlist? Add support for concatenation of AdsMediaSources Jan 25, 2018
@priscila225
Copy link
Author

priscila225 commented Jan 25, 2018

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?

@andrewlewis
Copy link
Collaborator

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.

@priscila225
Copy link
Author

priscila225 commented Jan 25, 2018

Makes sense, this seamless transition is awesome! Hope to have this soon. Thanks to mark as enhancement

@victorraft
Copy link

Hi, @andrewlewis, are there any updates on this one? Any idea of when this functionality could be released?
Thanks!

@andrewlewis
Copy link
Collaborator

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!

@cadalt
Copy link

cadalt commented Mar 2, 2018

I'm a dev working for a major media corporation... this would be a great feature for us

@13robot
Copy link

13robot commented Mar 27, 2018

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.

@andrewlewis
Copy link
Collaborator

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.

@jmann3
Copy link

jmann3 commented Apr 24, 2018

I'm a dev working for a major media corporation... this would be a great feature for us as well.

@KatieBarnett
Copy link

I am keen on this too!

@arazabishov
Copy link

+1

@kgrevehagen
Copy link

Would also love to get this feature!

@victorraft
Copy link

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.

@andrewlewis
Copy link
Collaborator

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.

@arazabishov
Copy link

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 :)

@andrewlewis
Copy link
Collaborator

It would be great if anyone who would like to use this feature could email dev.exoplayer@gmail.com with subject "Issue #3750" and provide a bit more detail on their app and use case. Thanks!

@Romantic-LiXuefeng
Copy link

I am very interested in this feature.

@bash-celik
Copy link

@andrewlewis hi, any updates?

@andrewlewis
Copy link
Collaborator

@gengar3 No updates I'm afraid.

@TheAutismChannel
Copy link

This would be wonderful for us as well.

@hermasyp
Copy link

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.

@cle-bo
Copy link

cle-bo commented Oct 9, 2019

+1

@bryandunbar
Copy link

Has anybody successfully worked around this limitation?

@meenukrishnamurthy
Copy link

@andrewlewis Any update on this feature.We also need this.I would be great if you guys take it as priority task

@davidmullis
Copy link

+1 for this feature, please.

@gmarques33
Copy link

+1

@mrcodeelements
Copy link

+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.

@universegalaxy1112
Copy link

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.

@andrewlewis
Copy link
Collaborator

I'm working on it at the moment.

@universegalaxy1112
Copy link

Hi, Andres, I tested IMA extension with test ad tags,
how can I get the real ad tags?

@kunal-chauhan9
Copy link

Hi @andrewlewis , Thanks for enriching Exoplayer. It would be great to know by when will this feature be added.

Thanks.

kim-vde pushed a commit that referenced this issue Oct 6, 2020
This is in preparation for supporting playlists of ads media sources using
ImaAdsLoader.

Existing ways of passing ad tags should still function but are deprecated (and
won't be supported with playlists).

Issue: #3750
PiperOrigin-RevId: 335618364
ojw28 pushed a commit that referenced this issue Oct 21, 2020
This is in preparation for supporting playlists of ads media sources using
ImaAdsLoader.

Existing ways of passing ad tags should still function but are deprecated (and
won't be supported with playlists).

Issue: #3750
PiperOrigin-RevId: 335618364
ojw28 pushed a commit that referenced this issue Nov 2, 2020
In a later change ImaAdsLoader will use multiple AdTagLoaders.

This change shouldn't have any substantial changes in behavior (it's almost
entirely moving code around). An exception is that ImaSdkSettings is configured
when making a request rather than at construction time.

Issue: #3750
PiperOrigin-RevId: 339891712
andrewlewis added a commit that referenced this issue Nov 6, 2020
In a later change, the AdPlaybackState will include the playing adsId (set by
the AdsLoader) and the ads loader will use this to determine what ad
information is associated with the playing/next periods, to allow loading ads
in playlists.

Apps can continue to pass just a URI for an ad tag with their MediaItem, in
which case the associated playlist will request that ad tag just and the same
state will be used for all occurrences of the ad tag.

This change has breaking changes to the AdsLoader interface and removes
deprecated ways of passing the ad tag, as it's very likely to go into a major
release anyway and not needing to handle the deprecated cases simplifies
ImaAdsLoader.

Issue: #3750
PiperOrigin-RevId: 340438580
andrewlewis added a commit that referenced this issue Nov 6, 2020
Issue: #3750
PiperOrigin-RevId: 341020676
andrewlewis added a commit that referenced this issue Nov 6, 2020
Issue: #3750
PiperOrigin-RevId: 341021084
andrewlewis added a commit that referenced this issue Nov 6, 2020
In preparation for adding support for ads in playlists:
- Make releasing a no-op if the instance was already released
- Remove null checks on non-null `adDisplayContainer` and `adsLoader`
- Move initializing the ads manager into a private method as it will need to be
  called from two places soon.
- Misc other cleanup.

Issue: #3750
PiperOrigin-RevId: 341021493
kim-vde pushed a commit that referenced this issue Nov 24, 2020
Issue: #3750
PiperOrigin-RevId: 343878310
kim-vde pushed a commit that referenced this issue Nov 24, 2020
- Remove restriction on `AdsMediaSource`s in playlists in `ExoPlayerImpl`.
- Allow playing playlists of `AdsMediaSource`s in the demo app.
- Add a sample with ads in a playlist in the demo app.

Issue: #3750
PiperOrigin-RevId: 344018774
icbaker pushed a commit that referenced this issue Dec 14, 2020
Issue: #3750
PiperOrigin-RevId: 346079830
christosts pushed a commit that referenced this issue Dec 17, 2020
It is more realistic for each source to have its own listener and to share
`TimelineWindowDefinition`s between them.

Issue: #3750
PiperOrigin-RevId: 347398769
christosts pushed a commit that referenced this issue Dec 17, 2020
Previously the `AdTagLoader` only had one listener which meant that updates
that should affect all periods with matching identifiers in the timeline only
affected the last-attached one. Fix this by having `AdTagLoader` track all its
listeners.

Issue: #3750
PiperOrigin-RevId: 347571323
christosts pushed a commit that referenced this issue Dec 17, 2020
Issue: #3750
PiperOrigin-RevId: 347572122
@andrewlewis
Copy link
Collaborator

This is implemented on the development branch and should be in the next major release 2.13.

@google google locked and limited conversation to collaborators Mar 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests