🎨Banner Video (Beta)

AdSter SDK also gives the option to load and show in-stream video ad in a banner format.

Create your AdRequestConfiguration as per the below format

val configuration = AdRequestConfiguration.Companion.builder(context, "Your_placement_name");

Load and show Banner Video Ad

Call loadAd() method as per below format

AdSterAdLoader.Companion.builder().withAdsListener(new MediationAdListener() {
    @Override
    public void onBannerVideoAdLoaded (@NonNull MediationBannerVideoAd ad){ 
        //Use the ad object provided here to display the ad
    }

    @Override
    public void onFailure (@NonNull AdError adError){ }
}).withAdsEventsListener(new AdEventsListener() {
    @Override
    public void onAdClicked() {
        //Handle ad click here
    }

    @Override
    public void onAdImpression() {
        //Handle ad impression here
    }
    
    @Override
    public void onAdRevenuePaid(double revenue, @NotNull String adUnitId,@NotNull String network) {
        // Callback which provides revenue and the network which provided it
    }
}).build().loadAd(configuration.build());

Also use the pause(),resume() and destroy() functions of the ad object provided in onBannerVideoAdLoaded(MediationBannerVideoAd ad) to pause , resume and destroy the video when the fragment or the activity is being paused , resumed and destroyed respectively. Below is an example :

Last updated