You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Thanks for the feature request. We should use ImaSdkFactory.createAudioAdDisplayContainer for this use case. I have a change in review that allows returning null from getAdViewGroup as a signal to create an audio ad display container.
Regarding detecting skippability, you can attach an AdEventListener via ImaAdsLoader.Builder.setAdEventListener then in onAdEvent check for AdEvent.getType() == SKIPPABLE_STATE_CHANGED and update your UI accordingly.
To actually skip the ad I plan to add ImaAdsLoader.skipAd (this is only for audio-only ads though, as the IMA SDK takes care of rendering the skipping UI for video ads).
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 :
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
The text was updated successfully, but these errors were encountered: