Video Interstitial

Video ads are full-screen videos that appear inside your application.

1. Load the video

Make sure you add the Tapdaq namespace to the top of your script:

using Tapdaq;

Before displaying a video to the user, please load the video ad as shown below:

AdManager.LoadVideo("main_menu");

2. Display the video

To display the video we recommend using the AdAvailable listener. To do this, create a callback method and subscribe it to the AdAvailable listener.

private void OnEnable() {
	TDCallbacks.AdAvailable += OnAdAvailable;
}

private void OnDisable() {
	TDCallbacks.AdAvailable -= OnAdAvailable;
}

private void OnAdAvailable(TDAdEvent e) {
	if (e.adType == "VIDEO" && e.tag == "main_menu") {
		AdManager.ShowVideo("main_menu");
	}
}

It is also possible to check the video is loaded before displaying it to the user, as shown below:

if (AdManager.IsVideoReady("main_menu")) {
	AdManager.ShowVideo("main_menu");
}

Note: We strongly advise against trying to show a video ad on application launch.*

Export your application to iOS and Android, then run your application to test the ad displays correctly.

3. Load another video on close

If you wish to load another video after you have shown one, implement one of the following options:

A. Auto Reload all Ads

To auto reload all ads using the same placement tag set the Auto Reload option in Tapdaq Settings, like so: Interstitial - Auto Reload

B. Implement Delegate Event

Add a delegate event for OnAdClosed, then call load within the delegate method like so:

// Subscribe to Tapdaq events
private void OnEnable () {
	TDCallbacks.AdClosed += OnAdClosed;
}

// Unsubscribe from Tapdaq events
private void OnDisable () {
	TDCallbacks.AdClosed -= OnAdClosed;
}

private void OnAdClosed(TDAdEvent e) {
	if (e.IsVideoEvent ()) {
		AdManager.LoadVideo(e.tag);
	}
}

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.

What's next?

Now that you have successfully integrated a video into your app, what would you like to do next?