3-4. Interstitial Video Ads (Non Reward)

It is an ad type that is similar to video ads but does not offer rewards.

Create an Interstitial Video Ads instance

private OAMInterstitialVideo    interstitialVideo;
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    ...
 
    interstitialVideo = new OAMInterstitialVideo( this );
}

Interstitial Video Ads PLACEMENT ID

Add the following code to set the PLACEMENT ID for the Interstitial Video Ads. The PLACEMENT ID for Interstitial Video Ads can be generated in the ONE AdMax console.

interstitialVideo.setPlacementId( PLACEMENT_ID );

Interstitial Video Ads network schedule timeout

When loading Interstitial Video Ads, a timeout is set for each network (mediation partner). If an ad is not received within the specified time, it will move on to the next network.

interstitialVideo.setNetworkScheduleTimeout( 10 ); // default 10 sec

Interstitial Video Ads request

interstitialVideo.load();

Excessive calls to the load() API will result in a block.

Interstitial Video Ads display

interstitialVideo.show();

Specify the Activity for displaying Interstitial Video Ads

This is used when displaying Interstitial Video Ads in an activity different from the one where the load() API was called.

interstitialVideo.setCurrentActivity( activity );

Check if the Interstitial Video Ads have been loaded

This is called to check whether the Interstitial Video Ads have been loaded or not.

interstitialVideo.isLoaded();

Interstitial Video Ads event listener

Set up listeners for events that occur when loading Interstitial Video Ads.

interstitalVideo.setEventListener( new IOAMInterstitialVideoEventListener(){
    @Override
    public void onLoaded(){                         // 전면 비디오 광고 loading 성공
        Log.d( Tag, "interstitalVideo load success" );
    }
 
    @Override
    public void onLoadFailed( OAMError error ){     // 전면 비디오 광고 loading 실패
        Log.d( Tag, "interstitalVideo load failed " + error.toString() );
    }
 
    @Override
    public void onOpened(){                         // 전면 비디오 광고 open 성공
        Log.d( Tag, "interstitalVideo open success" );
    }
 
    @Override
    public void onOpenFailed( OAMError error ){     // 전면 비디오 광고 open 실패
        Log.d( Tag, "interstitalVideo open failed " + error.toString() );
    }
 
    @Override
    public void onClosed(){                         // 전면 비디오 광고 종료
        Log.d( Tag, "interstitalVideo closed " + event );
    }
 
    @Override
    public void onClicked(){                        // 전면 비디오 광고 클릭. 일부 미디에이션 광고는 지원 안함
        Log.d( Tag, "interstitalVideo clicked" );
    }
} );
ONE AdMax SDK Error Codes

Interstitial Video Ad Sample Code

private OAMInterstitalVideo interstitialVideo;
 
@Override
protected void onCreate( Bundle savedInstanceState ){
    super.onCreate( savedInstanceState );
    ...
     
    // ONEAdMax 로그 활성화. apk release시에는 삭제해야 합니다.
    ONEAdMax.setLogEnable( true );
 
    //ONEAdMax SDK 초기화
    if( ONEAdMax.isInit( MyActivity.this ) == false ){
        ONEAdMax.init( MyActivity.this, new IOAMInitListener() {
            @Override
            public void onInitialized() {
                Log.d( Tag, "ONEAdMax SDK Initialized.");      
                    initInterstitialVideo( yourInterstitialViceoPlacementID );
            }
        });
    }
 
    ...
}
 
 
public void initInterstitialVideo( String youtPlacementId ){
    interstitialVideo = new OAMInterstitalVideo( this );
 
    // placementID는 필수입니다.
    interstitialVideo.setPlacementId( youtPlacementId );
 
    // optional   
    interstitialVideo.setNetworkScheduleTimeout( 10 ); 
 
    // listener를 등록하지 않으면 이벤트를 받을 수 없습니다.
    interstitialVideo.setEventListener( new IOAMInterstitialVideoEventListener(){
        @Override
        public void onLoaded(){                         // 전면 비디오 광고 loading 성공
            Log.d( Tag, "interstitalVideo load success" );
            // loading 성공 이후, showing.
            interstitialVideo.show();
        }
 
        @Override
        public void onLoadFailed( OAMError error ){     // 전면 비디오 광고 loading 실패
          Log.d( Tag, "interstitalVideo load failed " + error.toString() );
        }
 
        @Override
        public void onOpened(){                         // 전면 비디오 광고 open 성공
            Log.d( Tag, "interstitalVideo open success" );
        }
 
        @Override
        public void onOpenFailed( OAMError error ){     // 전면 비디오 광고 open 실패
          Log.d( Tag, "interstitalVideo open failed " + error.toString() );
        }
     
        @Override
        public void onClosed(){                         // 전면 비디오 광고 종료
            Log.d( Tag, "interstitalVideo closed " + event );
        }
 
        @Override
        public void onClicked(){                        // 전면 비디오 광고 클릭
            Log.d( Tag, "interstitalVideo clicked" );
        }
    } );
 
    interstitalVideo.load();
}
 
 
 
@Override
protected void onDestroy(){
    super.onDestroy();
    ONEAdMax.unInit();
}

Last updated