Before starting this chapter, be sure that you already finished SDK settings. If not, check 4) iOS Settings first. For video Ad, first you have to load a video Ad by invoking prepareVideoAd: method on an instance of TnkSession 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 on the instance of TnkSession. First parameter is the name of Display Logic. (See 5) Display Logic for detail) and second parameter is an instance of TnkVideoDelegate which receives events of video loadings. [TnkVideoDelegate] To get events from video Ads, you can put an instance of TnkVideoDelegate protocol in the second parameter of prepareVideoAd: method. [Video Ad Sample] In this sample , a 'Play' button is shown when a video ad is loaded and the video is played when user clicks the button. [Portrait-oriented App] Video Ad should be played only in landscape orientation. You have to add following code in your AppDelegate class to support landscape play of video ad if your app uses only portrait orientation. [Video Ad APIs] - TnkSession - prepareVideoAd: Method - (void) prepareVideoAd:(NSString *)logicName delegate:(id<TnkVideoDelegate>)delegate; - (void) prepareVideoAd:(NSString *)logicName delegate:(id<TnkVideoDelegate>)delegate repeat:(BOOL)repeatFlag; Description Load a video Ad. Once the video ad is loaded. you can play it by invoking showVideoAd: method. Parameters
- TnkSession - showVideoAd:Method - (BOOL) showVideoAd:(NSString *)logicName on:(UIViewController *)viewController; Description Play a video ad loaded by prepareVideoAd: method. Parameters
|
6. Video Ad >