//
|
// BUFullscreenVideoAd.h
|
// BUAdSDK
|
//
|
// Copyright © 2018年 bytedance. All rights reserved.
|
//
|
|
#import <Foundation/Foundation.h>
|
#import <UIKit/UIKit.h>
|
#import "BUAdSlot.h"
|
#import "BUMopubAdMarkUpDelegate.h"
|
|
typedef NS_ENUM(NSUInteger, BUFullScreenVideoAdType) {
|
BUFullScreenAdTypeEndcard = 0, // video + endcard
|
BUFullScreenAdTypeVideoPlayable = 1, // video + playable
|
BUFullScreenAdTypePurePlayable = 2 // pure playable
|
};
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
@class BUFullscreenVideoAd;
|
|
@protocol BUFullscreenVideoAdDelegate <NSObject>
|
|
@optional
|
|
/**
|
This method is called when video ad material loaded successfully.
|
*/
|
- (void)fullscreenVideoMaterialMetaAdDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad materia failed to load.
|
@param error : the reason of error
|
*/
|
- (void)fullscreenVideoAd:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
|
|
/**
|
This method is called when video cached successfully.
|
*/
|
- (void)fullscreenVideoAdVideoDataDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad slot will be showing.
|
*/
|
- (void)fullscreenVideoAdWillVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad slot has been shown.
|
*/
|
- (void)fullscreenVideoAdDidVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad is clicked.
|
*/
|
- (void)fullscreenVideoAdDidClick:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad is about to close.
|
*/
|
- (void)fullscreenVideoAdWillClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
This method is called when video ad is closed.
|
*/
|
- (void)fullscreenVideoAdDidClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
|
/**
|
This method is called when video ad play completed or an error occurred.
|
@param error : the reason of error
|
*/
|
- (void)fullscreenVideoAdDidPlayFinish:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
|
|
/**
|
This method is called when the user clicked skip button.
|
*/
|
- (void)fullscreenVideoAdDidClickSkip:(BUFullscreenVideoAd *)fullscreenVideoAd;
|
|
/**
|
this method is used to get the type of fullscreen video ad
|
*/
|
- (void)fullscreenVideoAdCallback:(BUFullscreenVideoAd *)fullscreenVideoAd withType:(BUFullScreenVideoAdType)fullscreenVideoAdType;
|
|
@end
|
|
@interface BUFullscreenVideoAd : NSObject <BUMopubAdMarkUpDelegate>
|
|
@property (nonatomic, weak, nullable) id<BUFullscreenVideoAdDelegate> delegate;
|
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid __attribute__((deprecated("Use fullscreenVideoMaterialMetaAdDidLoad: instead.")));
|
|
/// media configuration parameters.
|
@property (nonatomic, copy, readonly) NSDictionary *mediaExt;
|
|
/**
|
Initializes video ad with slot id.
|
@param slotID : the unique identifier of video ad.
|
@return BUFullscreenVideoAd
|
*/
|
- (instancetype)initWithSlotID:(NSString *)slotID;
|
|
/**
|
adload_seq:(针对聚合广告位)传递本次请求是为“自然日内某设备某广告位置第N次展示机会”发出的广告请求,同物理位置在自然日从1开始计数,不同物理位置独立计数;example:某原生广告位置,当天第5次产生展示机会,这次展示机向穿山甲发送了4次广告请求,则这4次广告请求的"adload_seq"的值应为5。第二天重新开始计数。
|
|
prime_rit:(针对聚合广告位)广告物理位置对应的固定穿山甲广告位id,可以使用第一层的广告位id也可以为某一层的广告位id,但要求同一物理位置在该字段固定上报同一广告位id,不频繁更换;example:某原生广告位,当天共发出了1000个请求,这1000个请求中使用了5个不同target的穿山甲rit,用某X rit来作为该位置的标记rit,则这1000次请求的prime_rit都需要上报X rit的rit id。
|
*/
|
|
- (instancetype)initWithSlotID:(NSString *)slotID adloadSeq:(NSInteger)adloadSeq primeRit:(NSString * __nullable)primeRit;
|
/**
|
Load video ad datas.
|
*/
|
- (void)loadAdData;
|
|
/**
|
Display video ad.
|
@param rootViewController : root view controller for displaying ad.
|
@return : whether it is successfully displayed.
|
*/
|
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
|
|
/**
|
Display video ad.
|
@param rootViewController : root view controller for displaying ad.
|
@param sceneDescirbe : optional. Identifies a custom description of the presentation scenario.
|
@return : whether it is successfully displayed.
|
*/
|
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
|
|
@end
|
|
NS_ASSUME_NONNULL_END
|