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.
- Swift
- Objective-C
self.videoAdManager?.requestTimeoutInterval = ...
self.videoAdManager.requestTimeoutInterval = ...
Automated Loudness
Use GFPAdConfiguration.useLoudness to automatically level audio volume. Default is NO
- Swift
- Objective-C
// GFPAdConfiguration.h
@property (nonatomic, assign) BOOL useLoudness;
GFPAdManager.adConfiguration().useLoudness = true
// GFPAdConfiguration.h
@property (nonatomic, assign) BOOL useLoudness;
[GFPAdManager adConfiguration].useLoudness = YES;
GFPVideoAdRenderingSetting
Configure GFPVideoAdRenderingSetting before requesting ad, in either GFPVideoAdManager or GFPVideoAdScheduleManager See more information in GFPVideoAdRenderingSetting.h.
- Swift
- Objective-C
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
...
GFPVideoAdRenderingSetting *renderingSetting = [[GFPVideoAdRenderingSetting alloc] init];
renderingSetting.startTimeoutInterval = 5; // Video start timeout
renderingSetting.bufferingTimeoutInterval = 7; // Video Buffering timeout
renderingSetting.bitrateKbps = 10; // Maximum bitrate
renderingSetting.preferredLanguage = GFPLanguageType_none; // "none" sets to device language
...
GFPVideoAdPlayerSetting
Configure GFPVideoAdPlayerSetting for various video player settings,in either GFPVideoAdManager와 GFPVideoAdScheduleManager See more information in GFPVideoAdPlayerSetting.h
- Swift
- Objective-C
let playerSetting = GFPVideoAdPlayerSetting(action: .pause, audioSetting: .default)
self.videoAdManager?.playerSetting = playerSetting
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithAction: GFPVideoBackgroundPause audioSetting: GFPVideoAudioSettingDefault];
self.videoAdManager.playerSetting = playerSetting;
GFPVideoBackgroundActionType
Configure GFPVideoBackgroundActionType for video's action when the app goes background.
- GFPVideoBackgroundPause : pause in background
- GFPVideoBackgroundPlay : continue in background
- Swift
- Objective-C
let playerSetting = GFPVideoAdPlayerSetting(action: .pause)
self.videoAdManager?.playerSetting = playerSetting
let playerSetting = GFPVideoAdPlayerSetting(action: .play)
self.videoAdManager?.playerSetting = playerSetting
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithAction: GFPVideoBackgroundPause];
self.videoAdManager.playerSetting = playerSetting;
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithAction: GFPVideoBackgroundPlay];
self.videoAdManager.playerSetting = playerSetting;
GFPVideoAudioSettingType
Configure GFPVideoAudioSettingType for video's actions when headphones are connected or disconnected.
GFPVideoAudioSettingDefault
: AVPlayer Default pause when headphones are disconnectedGFPVideoAudioSettingAuto
: Plays when headphones are connected. Pauses when headphones are disconnected
- Swift
- Objective-C
let playerSetting = GFPVideoAdPlayerSetting(audioSetting: .default)
self.videoAdManager?.playerSetting = playerSetting
let playerSetting = GFPVideoAdPlayerSetting(audioSetting: .auto)
self.videoAdManager?.playerSetting = playerSetting
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithAudioSetting: GFPVideoAudioSettingDefault];
self.videoAdManager.playerSetting = playerSetting;
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithAudioSetting: GFPVideoAudioSettingAuto];
self.videoAdManager.playerSetting = playerSetting;
disableExternalPlayback
Configure disableExternalPlayback
to allow or disallow external playbacks. Default is YES
See more information on AVPlayer allowsExternalPlayback
- Swift
- Objective-C
let playerSetting = GFPVideoAdPlayerSetting(disableExternalPlayback: false)
self.videoAdManager?.playerSetting = playerSetting
let playerSetting = GFPVideoAdPlayerSetting(disableExternalPlayback: true)
self.videoAdManager?.playerSetting = playerSetting
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithDisableExternalPlayback: NO];
self.videoAdManager.playerSetting = playerSetting;
GFPVideoAdPlayerSetting *playerSetting = [[GFPVideoAdPlayerSetting alloc] initWithDisableExternalPlayback: YES];
self.videoAdManager.playerSetting = playerSetting;
Adjusting Sound Level
- Set
volume
from [0, Muted] to [1, Loudest] volume
onGFPVideoAdScheduleManager
applies to all of its scheduled videos.volume
onGFPVideoAdManager
applies to single video that it manages.
- Swift
- Objective-C
// 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
// 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.
- Swift
- Objective-C
// 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
// 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
- Swift
- Objective-C
scheduleParam.noticeDurationSec = 5.0
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
- Swift
- Objective-C
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")
GFPTextAdViewAttribute *attribute = [[GFPTextAdViewAttribute alloc] initWithContainer: aContainer];
attribute.backgroundColor = [UIColor yellowColor];
attribute.textColor = [UIColor redColor];
attribute.verticalBarColor = [UIColor cyanColor];
attribute.closeIcon = [UIImage imageNamed: @"close"];
attribute.moreIcon = [UIImage imageNamed: @"more"];
Configuring NonLinear Outer Container
Use GFPVideoAdScheduleManager.replaceTextAdViewAttribute:
to configure GFPTextAdViewAttribute
.
- (void)replaceTextAdViewAttribute:(GFPTextAdViewAttribute *)textAdViewAttribute {
}