Help Center/Details/

New Cinema Ads

Introduction

Slip ads: Slip ads are a form of video advertising. Developers can set the advertising space before/during/after playing the video in their APP. The duration of the patch advertisement can be set to a fixed duration, such as 5s/15s, etc.; the fixed duration can also be unlimited, and the system returns the highest-profit advertisement within the range of 5-60s to help developers maximize revenue. Patch ads currently only support self-rendering. You can use the default CSJ player, or you can apply to use the developer's own player.

Supported ad size: horizontal video (aspect ratio: 1.78)

Permission

Self-rendered patch ads: By default, permission is required to apply
SDK version requirements: 3400 and above

Self-rendering ad request method

Instructions for use

**Self-rendered patch ads use the BUNativeAdsManager object to call loadAdDataWithCount: to request ads. By setting BUNativeAdsManagerDelegate, BUVideoAdViewDelegate, and BUNativeAdDelegate agents, you can get ad-related materials and click callbacks. **

Create an ad slot object and request an ad

BUNativeAdsManager

The advertisement slot object must be passed in when requesting an advertisement, and the advertisement slot ID and the basic advertisement configuration BUAdSlot must be passed in when the advertisement slot object is created.

Required parameters:

Field Definition Field Name Field Type Remarks
BUAdSlot / / Basic configuration
slotID Code Bit Code Bit ID

Use BUAdSlot to create basic advertising information, use BUNativeAdsManager to call loadAdDataWithCount: to request ads

BUNativeAdsManager *nad = [BUNativeAdsManager new];
BUAdSlot *slot = [[BUAdSlot alloc] init];
slot.ID = self.viewModel.slotID;
slot.AdType = BUAdSlotAdTypePaster;
slot.position = BUAdSlotPositionTop;
slot.imgSize = [BUSize sizeBy:BUProposalSize_Feed690_388];
nad.adslot = slot;
nad.delegate = self;
[nad loadAdDataWithCount:3];

Note: The number of loadAdDataWithCount requests is recommended to be no more than 3 per request**

Receive ads loading results

Callback Method Notes
nativeAdsManagerSuccessToLoad: nativeAds: Load success callback; perform related data insertion processing in this callback
nativeAdsManager:didFailWithError: The returned error code (error) indicates the reason why the ad failed to load. Please refer to the link for details of all error codes. Link

BUNativeAdDelegate callback description

Callback Method Notes
nativeAdDidLoad: Ad materials loaded successfully
nativeAd:didFailWithError: The returned error code (error) indicates the reason why the ad failed to load. Please refer to the link for details of all error codes. Link
nativeAdDidBecomeVisible: Ad display callback
nativeAdDidCloseOtherController: interactionType: This callback is called when the ad jumps to another controller, and the controller is closed. InteractionType: This parameter can be distinguished from the opened appstore/webpage/video ad details page
nativeAdDidClick:withView: Except for the video area, click will respond to this callback method
nativeAd:dislikeWithReason: dislike button click callback, you need to process the response data in this callback method

Custom player

The media may want to use the player in their own project to control more details of the video playback. When the allowCustomVideoPlayer in the advertising material BUMaterial is YES, the media is allowed to play the video through the videoUrl provided by BUMaterialMeta, and the media needs to use the BUVideoAdReportor protocol method to report.

Custom player buried point report

The media needs to use the videoAdReportor in the BUNativeAdRelatedView to report the video playback points.

1. Create a buried point reporting tool object
BUNativeAdRelatedView *nativeAdRelatedView = [[BUNativeAdRelatedView alloc] init];
/// @param nativeAd advertising material
[nativeAdRelatedView refreshData:nativeAd];
2. Buried point report

**The reporting of buried points is provided by the interface provided by the BUVideoAdReportor protocol, which is reported according to different playback status. **

/// the reportor of video ad in feed, auto created by system if video ads in feed is customd.
@protocol BUVideoAdReportor <NSObject data-tomark-pass >

@required

/// report did start play video
/// @param duration total duration of video, unit ms
-(void)didStartPlayVideoWithVideoDuration:(NSTimeInterval)duration;

/// report did start play video auto, designed by developer
/// @param duration total duration of video, unit ms
-(void)didAutoStartPlayWithVideoDuration:(NSTimeInterval)duration;

/// report did play to the end of video
-(void)didFinishVideo;

/// report did pause video
/// @param duration duration of video that user watched
-(void)didPauseVideoWithCurrentDuration:(NSTimeInterval)duration;

/// report did resume video from paused
/// @param duration duration of video that user watched
-(void)didResumeVideoWithCurrentDuration:(NSTimeInterval)duration;

/// report did break video playing, maybe change another video or disappear from screen and so on
/// @param duration duration of video that user watched
-(void)didBreakVideoWithCurrentDuration:(NSTimeInterval)duration;

/// report did click video view, auto implement by Pangle, developers need not call this method
/// @param duration duration of video that user watched
-(void)didClickVideoViewWithCurrentDuration:(NSTimeInterval)duration;

/// report sth. wrong with playing
/// @param error error
-(void)didPlayFailedWithError:(NSError *)error;

@end

Report the buried points when the custom playback status changes

-(void)reportPangleWithStatus:(BUDVideoViewStatus)status {
    [super reportPangleWithStatus:status];
    if (self.currentAdIndex >= self.currentAds.count) {
        return;
    }
    
    BUDPasterContentView *currentAdView = self.adViews[self.currentAdIndex];
    id <BUVideoAdReportor> reportor = currentAdView.videoAdReportor;
    BUDVideoView *view = currentAdView.customVideoView;
    switch (status) {
        case BUDVideoViewStatusPlaying: {
            NSTimeInterval duration = view.durationOfCurrentItem;
            [reportor didStartPlayVideoWithVideoDuration:duration];
        }
            break;
        case BUDVideoViewStatusPaused: {
            NSTimeInterval duration = view.watchedDurationOfCurrentItem;
            [reportor didPauseVideoWithCurrentDuration:duration];
        }
            break;
        case BUDVideoViewStatusStopped: {
            [reportor didFinishVideo];
        }
            break;
        case BUDVideoViewStatusResumed: {
            NSTimeInterval duration = view.watchedDurationOfCurrentItem;
            [reportor didResumeVideoWithCurrentDuration:duration];
        }
            break;
        case BUDVideoViewStatusAbort: {
            NSTimeInterval duration = view.watchedDurationOfCurrentItem;
            [reportor didBreakVideoWithCurrentDuration:duration];
        }
        default:
            break;
    }
}
Event description:
Event name Timing of reporting Meaning
didStartPlayVideoWithVideoDuration: Report when the video starts Report this event when the video starts to play, duration is the video duration
didPauseVideoWithCurrentDuration: Report when the video is paused Video pause is to report this event, duration is the length of time the video has been played when the video is paused
didFinishVideo Report when the video is finished Report this event when the video is finished
didResumeVideoWithCurrentDuration: Report when the video is replayed Report this event when the video is replayed, duration is the length of time the video has been played when the video is replayed
didBreakVideoWithCurrentDuration: Report when the video is abnormal Report when the video is abnormal, duration is the length of time the video has been played when the abnormality occurs

resource

For detailed access, please refer to the BUDCustomVideoPlayerViewController class in Demo, and for the advertisement loading request part, please refer to the loadAdData method

SDK player access

The media uses the SDK player and needs to use the videoAdView in the BUNativeAdRelatedView to add to the self-rendered ad view. At this time, the video playback and embedding are controlled by the SDK.

BUNativeAdRelatedView *nativeAdRelatedView = [[BUNativeAdRelatedView alloc] init];
/// @param nativeAd advertising material
[nativeAdRelatedView refreshData:nativeAd];
[self addSubview:nativeAdRelatedView.videoAdView];

For detailed access, please refer to the BUDPasterContentView class in Demo. The content of BUNativeAdRelatedView needs to be refreshed with refreshData:

Switching of post ads

Multiple post advertisement media can be switched or adjusted in order according to needs, and the duration of each post advertisement can be obtained through the attribute videoDuration of BUMaterialMeta.

Post ad click event

Media self-rendered patch ads need to use registerContainer:withClickableViews:clickableViews to register the bound clickable View

BUNativeAd *ad = self.currentAds[self.currentAdIndex];
BUDPasterContentView *currentAdView = self.adViews[self.currentAdIndex];
...
// Register click event
[ad registerContainer:currentAdView withClickableViews:@[currentAdView.creativeBtn]];
ad.rootViewController = self;
// refresh the UI
[currentAdView refreshUIWithModel:ad];
Click event callback:
Callback method Notes Notes
- (void)videoAdViewDidClick: SDK player click event SDK player only
- (void)videoAdViewDidCloseOtherController: This callback is called when the ad jumps to another controller and the controller is closed. InteractionType: This parameter can be distinguished from the opened appstore/webpage/video ad details page. Used for the callback when the SDK player clicks to close the controller. Only for SDK players
- (void)nativeAdDidClick:withView: The click event of the entire ad area. If the SDK player is used, it means the click event of the non-video area
- (void)nativeAdDidCloseOtherController:interactionType: This callback is called when the ad jumps to another controller and the controller is closed. InteractionType: This parameter can be distinguished from the opened appstore/webpage/video ad details page
- (void)nativeAd:dislikeWithReason: Using the close button provided in BUNativeAdRelatedView, the callback when the close button is clicked

For details, please refer to the BUDPasterBaseViewController class in Demo

Precautions

  1. After obtaining the relevant advertisement information assignment in the material loading success method, you need to call registerContainer:withClickableViews:clickableViews to register the bound clickable View and refresh the data source refreshData:.
  2. You need to refresh and call the refreshData: method after each material information is obtained
Did the content solve your problem?
Contact us