简体   繁体   中英

How to customize Exoplayer video ads UI?

I am newly using Exoplayer IMA SDK for playing ads. I am using video ads from DFP(doubleclick for Publishers).

I know how to customize Exoplayer controller UI from xml layout, but I want to know, can we remove the ads Ads(time) text at bottom of ads and learn more button from the top of ads. As they are our own ads, I want to remove those overlays.

I didn't find anything related to this. I had customize Adsense or AdMob Ads programmatically but I don't know how to customize Video Ads in Exoplayer IMA SDK or old Google IMA Android SDK.

I am using https://github.com/google/ExoPlayer/tree/release-v2/demos/ima

在此处输入图像描述

I haven't actually tried it but ima ads would provide listener so that you can listen ads events like AdStart or AdEnd, so you can try to listen these and try to add some view at end so that time is not visible. Give it a try.

Checkout Madman . The Madman library (Media Ads Manager) enables you to advertise video contents with video ads.

The Madman-Exoplayer-Extension provides an easy way to glue the madman sdk with the exoplayer instance.

The library is designed to

  1. retrieve ads from VAST-compliant ad servers
  2. help handle ad playback
  3. collect and report metrics back to ad servers.
  4. have full control over the UI

IMA SDK uses AdViewProvider to show all views related to ads (ad time, learn more, ...). The view should be returned in method getAdViewGroup and you can hide that view by simply changing its visibility.

The Exoplayer demo uses StyledPlayerView as an implementation of AdViewProvider . You may refer to this link fot the implementation. Changing that view's visibility will hide the ad related ui.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM