Skip to main content

Instream Video Ad Options

Ad Requset Timeout

Set timeout (seconds) for ad requests. GFPVideoAdManager will call videoAdManager:didFailWithError:responseInfo: on timeout. Default is 60 seconds.

self.videoAdManager?.requestTimeoutInterval = ...

Automated Loudness

Use GFPAdConfiguration.useLoudness to automatically level audio volume. Default is NO

// GFPAdConfiguration.h

@property (nonatomic, assign) BOOL useLoudness;
GFPAdManager.adConfiguration().useLoudness = true

GFPVideoAdRenderingSetting

Configure GFPVideoAdRenderingSetting before requesting ad, in either GFPVideoAdManager or GFPVideoAdScheduleManager See more information in GFPVideoAdRenderingSetting.h.

let renderingSetting = GFPVideoAdRenderingSetting()
renderingSetting.startTimeoutInterval = 5 // Video start timeout
renderingSetting.bufferingTimeoutInterval = 7 // Video Buffering timeout
renderingSetting.bitrateKbps = 10 // Maximum bitrate
renderingSetting.preferredLanguage = .none // "none" sets to device language
...

GFPVideoAdPlayerSetting

Configure GFPVideoAdPlayerSetting for various video player settings,in either GFPVideoAdManagerGFPVideoAdScheduleManager See more information in GFPVideoAdPlayerSetting.h

let playerSetting = GFPVideoAdPlayerSetting(action: .pause, audioSetting: .default)
self.videoAdManager?.playerSetting = playerSetting

GFPVideoBackgroundActionType

Configure GFPVideoBackgroundActionType for video's action when the app goes background.

  • GFPVideoBackgroundPause : pause in background
  • GFPVideoBackgroundPlay : continue in background
let playerSetting = GFPVideoAdPlayerSetting(action: .pause)
self.videoAdManager?.playerSetting = playerSetting

let playerSetting = GFPVideoAdPlayerSetting(action: .play)
self.videoAdManager?.playerSetting = playerSetting

GFPVideoAudioSettingType

Configure GFPVideoAudioSettingType for video's actions when headphones are connected or disconnected.

  • GFPVideoAudioSettingDefault: AVPlayer Default pause when headphones are disconnected
  • GFPVideoAudioSettingAuto: Plays when headphones are connected. Pauses when headphones are disconnected
let playerSetting = GFPVideoAdPlayerSetting(audioSetting: .default)
self.videoAdManager?.playerSetting = playerSetting

let playerSetting = GFPVideoAdPlayerSetting(audioSetting: .auto)
self.videoAdManager?.playerSetting = playerSetting

disableExternalPlayback

Configure disableExternalPlayback to allow or disallow external playbacks. Default is YES

See more information on AVPlayer allowsExternalPlayback

let playerSetting = GFPVideoAdPlayerSetting(disableExternalPlayback: false)
self.videoAdManager?.playerSetting = playerSetting

let playerSetting = GFPVideoAdPlayerSetting(disableExternalPlayback: true)
self.videoAdManager?.playerSetting = playerSetting

Adjusting Sound Level

  • Set volume from [0, Muted] to [1, Loudest]
  • volume on GFPVideoAdScheduleManager applies to all of its scheduled videos.
  • volume on GFPVideoAdManager applies to single video that it manages.
// GFPVideoAdScheduleManager.h
@interface GFPVideoAdScheduleManager : NSObject

@property (nonatomic, assign) float volume;

@end

// GFPVideoAdManager.h
@interface GFPVideoAdManager : NSObject

@property (readwrite, nonatomic, assign) float volume;

@end
//Example

self.scheduleManager?.volume = 15

self.videoAdManager?.volume = 15

Google IMA Video Ad Play Requirements

  • For IMA >= 3.12.1 (GFPSDK >= 2.2.4), it is necessary to set the root view controller for the video ad manangers.
// GFPVideoAdScheduleManager.h
@interface GFPVideoAdScheduleManager : NSObject

@property (nonatomic, weak, nullable) UIViewController *rootViewController;

@end

// GFPVideoAdManager.h
@interface GFPVideoAdManager : NSObject

@property (nonatomic, weak, nullable) UIViewController *rootViewController;

@end
//Example

self.scheduleManager?.rootViewController = self

self.videoAdManager?.rootViewController = self

Auxiliary

Quality of Experience(QOE)

Implement GFPVideoAdManager.qoeDelegate and GFPVideoAdScheduleManager.qoeDelegate to get more detailed informations about video playback.

See More information on GFPVideoAdQoeDelegate.h and GFPVideoAdQoeInfo.h

Preliminary Ad Notice Duration

Video ad notice label refers to text label such as "Plays Ad in 5 Seconds", in advance of start playing ad video.

Set duration by GFPAdScheduleParam.noticeDurationSec

See its delegate method

scheduleParam.noticeDurationSec = 5.0

Controlling Player UI

See more information in GFPVideoAdScheduleManager.h.

Showing Overlays (playback slider, pause button, resume button, election notice label and end text)

- (void)showOverlayView;

Hiding Overlays

- (void)hideOverlayView;

Showing RemindAd(Banner, Text)

Remind Ad is a pop-up small image or text view showing after video ad ended.

- (void)showRemindAd;

Hiding RemindAd(Banner, Text)

- (void)hideRemindAd;

Video Ad PiP UI Configuration

Set displayMode to change ad video player's UI to be taylored according to video being played in a picture in picture(PiP) or a normal context.

  • Normal Mode

샘플 이미지 샘플 이미지

self.scheduleManager.displayMode = [GFPVideoDisplayMode normal];
  • PiP Mode

샘플 이미지 샘플 이미지

self.scheduleManager.displayMode = [GFPVideoDisplayMode pip];

PiP Callbacks

Set a GFPVideoAdScheduleManagerPIPDelegate to the GFPVideoAdScheduleManager

On Close Button Tapped
- (void)scheduleManager:(GFPVideoAdScheduleManager *)aScheduleAdManager didTappedCloseBtnInPIP:(GFPVideoAdBreakResult *)aResult {

}
On Return Button Tapped
- (void)scheduleManager:(GFPVideoAdScheduleManager *)aScheduleAdManager didTappedReturnBtnInPIP:(GFPVideoAdBreakResult *)aResult {

}

Implementing Remind Ad for SMR

Customize the Remind Ad by configuring GFPTextAdViewAttribute.

See more information in Yobi internal document: Scheduled Ad Guide

let attribute = GFPTextAdViewAttribute(container: aContainer)
attribute.backgroundColor = UIColor.yellow
attribute.textColor = UIColor.red
attribute.verticalBarColor = UIColor.cyan
attribute.closeIcon = UIImage(named: "close")
attribute.moreIoon = UIImage(named: "more")

Configuring NonLinear Outer Container

Use GFPVideoAdScheduleManager.replaceTextAdViewAttribute: to configure GFPTextAdViewAttribute.

- (void)replaceTextAdViewAttribute:(GFPTextAdViewAttribute *)textAdViewAttribute {

}