Video Ads | Android

Similar to Interstitial Ads, Video Ads are shown in fullscreen mode and can be placed before, in-between, or after the app content. The Video Ad will be loaded in the background and will be waiting for a signal to show up.

First, the Video Player requires activity declaration in your AndroidManifest.xml:

<activity android:name="" android:configChanges="keyboardHidden|orientation|screenSize" />

Second, you need to instantiate a Video Object in the activity where you want to show video ads and to implement the VASTAdListener interface to have more control over the Video Ads. Your IDE will ask you to implement the following method:

public class MyActivity implements VASTAdListener {

    protected void onCreate(Bundle savedInstanceState) {
        Video videoAd = new Video(this);
    // Called when the video has been loaded.
    public void onReadyToShow() {
        // Call this when you want to show the video ad.;

    public void onWillShow() {
        // Called when the ad will show.

    public void onWillOpenLandingPage() {
        // Called when the banner has been clicked.

    public void onWillClose() {
        // Called when Interstitial ad will be closed.

    public void onFailedToLoadAd() {
        // called when video failed to load.

Third, you will need to provide the SDK with your Smaato Publisher ID and the AdSpace IDs. Please use the following lines:


Last, you need to load a new Video Ad using the following method:


Auto-Close Feature

With the current Android SDK you can configure an auto-close duration in seconds as well as an auto-close after a given number of seconds upon Interstitial Video Ad completion.

By default, auto-close is enabled meaning after the video completion, the ad will automatically close after the default of 3 seconds.

videoAd.setAutoCloseDuration(5);   // default value is 3 seconds

You can also completely disable the auto-close feature on VAST Ad completion.

videoAd.disableAutoClose(true);   // default value is false.

Configurable Skip button

From Android SDK version 5.1 and on, you can also configure a skip button appearance after a duration in seconds. By default, videos are skippable after 15 seconds.

videoAd.setVideoSkipInterval(5);   // default value is 5 seconds

Last Modified: February 20, 2020 at 2:53 pm

© 2005-2020 Smaato, Inc. All Rights Reserved. Smaato® is a registered trademark of Smaato, Inc.

Privacy Policy | Cookie Policy | Support