Interstitial

Interstitial ads zoneType: Interstitial

Interstitial ads do not need to create a container. Ads are rendered by calling the window.adsTag.adBreak({ zoneId, type, adBreakDone }) method.

Parameter Description:

parameter
type
illustrate
Is it necessary to transmit
default value

zoneId

string

Specify the ad unit group. Use this parameter to distinguish the ad group revenue.

yes

--

type

string

Specify the ad type. You can pass parameters: preroll, midroll, reward

yes

--

adBreakDone

function

The function is executed after the interstitial ad fails or finishes playing. The parameter viewed returns the display status of the ad.

no

(viewed) => {}

beforeAd

function

The event before the interstitial ad is displayed. The parameter success returns the ad pull status

no

(success) => {}

useLoading

boolean

Whether to use loading style

no

false

volume

number

The volume of the video ad. The optional value is between 0 and 1. Setting it to 0 means muting the video ad. Note: When there is no user interaction, the volume will be forcibly set to 0.

no

1

rewardSkipSecond

number

The number of seconds that reward ads can skip. This is only valid when type=reward

no

5

dom

Element

Specifies the container where the interstitial screen is located. By default, it is not specified.

no

--

Example:

View Demo

// Rendering interstitial ads
window.adsTag.adBreak({ zoneId: 'xxx', type: 'midroll', adBreakDone: (viewed) => {
    if (viewed) {
        // Ad successfully displayed
   } else {
        // Ad display failed or was aborted by the user
   }
}});

// Destroy interstitial ads
adsTag.closeAdBreak({ zoneId: 'xxx' });

// Pause interstitial ads (effective when the video is currently playing)
adsTag.pauseAdBreak({ zoneId: 'xxx' });

// Restore interstitial ads (effective when the video is currently playing)
adsTag.resumeAdBreak({ zoneId: 'xxx' });

Last updated