Skip to content

[Ads] Make AdsLoader.AdViewProvider optional in AdsMediaSource and access to SkipAd field #7689

@RadioFranceAndroidDev

Description

@RadioFranceAndroidDev

I work on an audio application (no videos), and we use ExoPlayer with Ads and a VAST server. We work in a library, used by many applications. We don't have access to the player view - or any android view - when we create the AdsMediaSource. We use a trick like this for the moment :

final AdsMediaSource adsMediaSource = new AdsMediaSource(mediaSource, dataSourceFactory, adsLoader, new AdsLoader.AdViewProvider() {
                                        @Override
                                        public ViewGroup getAdViewGroup() {
                                            return new FrameLayout(context.getApplicationContext());
                                        }

                                        @Override
                                        public View[] getAdOverlayViews() {
                                            return new ArrayList<View>().toArray(new View[0]);
                                        }
                                    });
 

It works like a charm, but it's not very clean. Can you make the AdsLoader.AdViewProvider optional ? We just need the SkipAd information in this case, to display manually the Skip button and also the skip value to knon when display it. Can we have a getter to retrieve this two fields ?

Thanks in advance,

RadioFranceTeam

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions