Native Outstream
Outstream ads are supported starting from NAMSDK version 6.2.0.
From NAMSDK version 7.3.0, you can choose the UI of the Outstream ad.
Native Integration Guide
Outstream is a Native Normal type ad. For details on Native Normal integration, refer to the guide here.
Outstream Player UI
Outstream ads display video within a MediaView.
To configure the control UI for Outstream, refer to the guide on GFPVideoOptions's viewType. If you want to create a custom control UI per media, check the useCustomControlView guide.
Outstream API
enableMediaBackgroundBlur
Sets whether to blur the margin of the media view in native ads. (Default is NO) This blur is applied only when a thumbnail image is available; if not, a black background will appear.
GFPAdNativeOptions *nativeOptions = [[GFPAdNativeOptions alloc] init];
GFPNativeAdRenderingSetting *renderingSetting = [[GFPNativeAdRenderingSetting alloc] init];
renderingSetting.enableMediaBackgroundBlur = NO;
renderingSetting.enableMediaBackgroundBlur = YES;
nativeOptions.renderingSetting = renderingSetting;
GFPVideoOptions
Use GFPVideoOptions to configure playback policy, useCustomControlView, and maximum video quality for Outstream ads.
GFPVideoOptions should be passed through the nativeOptions of the adLoader.
GFPAdNativeOptions *nativeOptions = [[GFPAdNativeOptions alloc] init];
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyAutoPlay useCustomControlView:NO];
nativeOptions.videoOptions = videoOption;
GFPVideoPlayPolicy
Sets the playback policy for the ad video. (Default is Auto)
- Auto: SDK automatically controls video playback. Video plays until the end on both WiFi and Cellular.
- Auto Only WiFi: SDK controls video playback. Video plays to the end only on WiFi. On Cellular, it stops after a few seconds.
- Manual: The service controls playback. Video appears paused by default, and playback is triggered manually by the service.
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyAutoPlay useCustomControlView:NO];
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyAutoPlayOnlyWiFi useCustomControlView:NO];
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyManual useCustomControlView:NO];
useCustomControlView
Determines whether to use a custom control view for the ad video. (Default is NO) If set to YES, the SDK hides its default control UI; if NO, the SDK provides built-in controls.
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyAutoPlay useCustomControlView:NO];
GFPVideoOptions *videoOption = [[GFPVideoOptions alloc] initWithPlayPolicy:GFPVideoPlayPolicyAutoPlay useCustomControlView:YES];
maxBitrateKbps
Sets the maximum bitrate for the ad video. (Default is 800 kbps)
videoOption.maxBitrateKbps = 800;
viewType (since 7.3.0)
viewType | description | |
---|---|---|
Default | Clicking the video shows control buttons. | ![]() |
Landing | Clicking the video opens the advertiser’s landing page. | ![]() |
GFPVideoOptions *videoOptions = [[GFPVideoOptions alloc] initWithPlayPolicy: GFPVideoPlayPolicyAutoPlay viewType: GFPVideoViewTypeDefault];
GFPVideoOptions *videoOptions = [[GFPVideoOptions alloc] initWithPlayPolicy: GFPVideoPlayPolicyAutoPlay viewType: GFPVideoViewTypeLanding];
GFPMediaData
For Native Normal types, ads are delivered via adLoader:didReceiveNativeAd. For more information about GFPAdLoaderDelegate, refer to link
You can retrieve the information rendered in MediaView through nativeAd.mediaData.
GFPMediaData *mediaData = nativeAd.mediaData;
mediaType
Determines the type of media in the ad.
- GFPMediaTypeImage: Image
- GFPMediaTypeVideo: Video
- GFPMediaTypeRichMedia: Rich media (e.g., special DA)
- GFPMediaTypeUnknown: Ads served via C2S platforms like Google, Meta, InMobi, etc.
GFPMediaType mediaType = nativeAd.mediaData.mediaType;
aspectRatio
Returns the media's aspect ratio. If not available, returns -1.
CGFloat aspectRatio = nativeAd.mediaData.aspectRatio;
videoController
Available only when mediaType is Video. Returns nil if not present.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
GFPVideoController
Use videoController to get video playback info (e.g., progressInfo, isMuted) and to control video playback.
progressInfo
Provides video duration, currentTime, and bufferedTime.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
GFPVideoProgressInfo *progressInfo = videoController.progressInfo;
NSTimeInterval duration = progressInfo.duration;
NSTimeInterval currentTime = progressInfo.currentTime;
NSTimeInterval bufferedTime = progressInfo.bufferedTime;
isPlaying
Returns whether the video is currently playing.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
BOOL isPlaying = videoController.isPlaying;
enableControl
Indicates whether video controls are enabled.
- If playPolicy is Manual: enableControl returns YES.
- Otherwise: enableControl returns NO.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
BOOL enableControl = videoController.enableControl;
preferredForwardBufferDuration
Sets the preferredForwardBufferDuratio for the ad video.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
videoController.preferredForwardBufferDuration = 0;
mute
Sets or retrieves mute status of the ad video.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
[videoController setMute: YES];
[videoController setMute: NO];
BOOL isMute = videoController.isMuted;
play
Plays the ad video. Only works when enableControl is YES.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
[videoController play];
pause
Pauses the ad video. Only works when enableControl is YES.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
[videoController pause];
stop
Stops the ad video and resets it to the beginning. Only works when enableControl is YES.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
[videoController stop];
GFPVideoEventDelegate
Set this delegate on the videoController to receive video playback events.
GFPVideoController *videoController = nativeAd.mediaData.videoController;
videoController.delegate = self;
adPlayerDidPlay:
Called when the ad video starts playing.
- (void)adPlayerDidPlay:(GFPVideoController *)videoController {
}
adPlayerDidPause:
Called when the ad video is paused.
- (void)adPlayerDidPause:(GFPVideoController *)videoController {
}
adPlayerDidComplete:
Called when the ad video completes playback.
- (void)adPlayerDidComplete:(GFPVideoController *)videoController {
}
adPlayerDidChangeMuteState:
Called when the mute state of the ad player changes.
- (void)adPlayerDidChangeMuteState:(GFPVideoController *)videoController {
}
adPlayer:didChangeCurrentTime:
Called when the current playback time of the video changes.
- (void)adPlayer:(GFPVideoController *)videoController didChangeCurrentTime:(NSTimeInterval)currentTime {
}
adPlayer:didChangeBufferedTime:
Called when the buffered time of the video changes.
- (void)adPlayer:(GFPVideoController *)videoController didChangeBufferedTime:(NSTimeInterval)bufferedTime {
}
adPlayer:didTappedControlButton:
(Optional) Called when a control button in the native ad video is tapped. This is only triggered when using the default control view, not when using a customControlView.
- (void)adPlayer:(GFPVideoController *)videoController didTappedControlButton:(GFPControlButtonType)buttonType {
}