Before starting this chapter, be sure that you already finished SDK settings. If not, check [6) Cocos2dx Settings] first. For video Ad, you have to load a video Ad by invoking prepareVideoAd() method and showVdieoAd() to play it. Once you have invoked prepareVideoAd() method, next video Ads are being loaded automatically at background task. [Loading a Video Ad] To load a video Ad, you have to invoke prepareVideoAd() method of TnkAdPlugin. First parameter is the name of Display Logic. (See 5) Display Logic for detail) and second parameter is the number to identify EventHandler. (See B. EventHandler for detail.) EventHandler is used for receiving events of video loading. [EventHandler] By EventHandler, you can get events releated to video Ad such as loading completion and closing video ad and can implements any logics you need for each events. EventHandler is also used for getting result from async invocations such as querying points and withdrawing points and used for getting events from interstitial Ads and video Ads. See [EventHandler] for detail. Events related to video Ads are as followings.
[Video Ad Sample] [Video Ad APIs] - TnkPlugin::prepareVideoAd() Method - void TnkPlugin::prepareVideoAd(const char *displayLogic) - void TnkPlugin::prepareVideoAd(const char *displayLogic) - void TnkPlugin::prepareVideoAd(const char *displayLogic, int handleId) Description Load a video Ad. Once the video ad is loaded, you can play it by invoking showVideoAd() method. Parameters
- TnkPlugin::prepareVideoAdOnce() Method - void TnkPlugin::prepareVideoAdOnce(const char *displayLogic, int handleId) Description Load a video Ad just once. If you want to load a video again, you have to invoke this API again. Once the video ad is loaded, you can play it by invoking showVideoAd() method. If loading a video has failed, onFailure() Event is invoked. Parameters
|
6. Video Ad >