短剧
@interface ZJTubePage : ZJAd <ZJContentInfo>
@property (nonatomic, readonly) UIViewController *viewController;
@property (nonatomic, weak) id <ZJContentPageVideoStateDelegate> videoStateDelegate;
@property (nonatomic, weak) id <ZJContentPageStateDelegate> stateDelegate;
@property (nonatomic, weak) id <ZJShortPlayPlayerDelegate> playerCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayAdDelegate> adCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayInterfaceDelegate> interfaceCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayCustomViewDelegate> customViewCallBackDelegate;
@property (nonatomic, weak) id <ZJShortPlayCustomDrawAdViewDelegate> customDrawAdViewCallBackDelegate;
@property (nonatomic, weak) id <ZJShortPlayDrawVideoViewControllerBannerDelegate> drawVideoViewBannerCallbackDelegate;
+ (void)setConfig:(ZJTubePageConfig *)config;
@end
- 视频状态代理
ZJContentPageVideoStateDelegate
videoStateDelegate;
@optional
* 视频开始播放
* @param videoContent 内容模型
*/
- (void)zj_videoDidStartPlay:(id<ZJContentInfo>)videoContent;
* 视频暂停播放
* @param videoContent 内容模型
*/
- (void)zj_videoDidPause:(id<ZJContentInfo>)videoContent;
* 视频恢复播放
* @param videoContent 内容模型
*/
- (void)zj_videoDidResume:(id<ZJContentInfo>)videoContent;
* 视频停止播放
* @param videoContent 内容模型
* @param finished 是否播放完成
*/
- (void)zj_videoDidEndPlay:(id<ZJContentInfo>)videoContent isFinished:(BOOL)finished;
* 视频播放失败
* @param videoContent 内容模型
* @param error 失败原因
*/
- (void)zj_videoDidFailedToPlay:(id<ZJContentInfo>)videoContent withError:(NSError *)error;
- 页面状态代理
ZJContentPageStateDelegate
stateDelegate
* 内容展示
* @param content 内容模型
*/
- (void)zj_contentDidFullDisplay:(id<ZJContentInfo>)content;
* 内容隐藏
* @param content 内容模型
*/
- (void)zj_contentDidEndDisplay:(id<ZJContentInfo>)content;
* 内容暂停显示,ViewController disappear或者Application resign active
* @param content 内容模型
*/
- (void)zj_contentDidPause:(id<ZJContentInfo>)content;
* 内容恢复显示,ViewController appear或者Application become active
* @param content 内容模型
*/
- (void)zj_contentDidResume:(id<ZJContentInfo>)content;
- (void)zjAdapter_contentTaskComplete:(id<ZJContentInfo>)content;
- 短剧播放器回调
ZJShortPlayPlayerDelegate
playerCallbackDelegate
- (void)zj_shortplayDrawVideoCurrentVideoChanged:(NSInteger)index adapter:(id<ZJContentInfo>)content;
- (void)zj_shortplayDrawVideoDidClickedErrorButtonRetry:(id<ZJContentInfo>)content;
- (void)zj_shortplayDrawVideoCloseButtonClicked:(id<ZJContentInfo>)content;
- (void)zj_shortplayDrawVideoDataRefreshCompletion:(NSError *)error content:(id<ZJContentInfo>)content;
- (void)zj_shortplayPageViewControllerSwitchToIndex:(NSInteger)index content:(id<ZJContentInfo>)content;
- (UIView *)zj_shortplayDrawVideoVCBottomBannerView:(UIViewController *)vc content:(id<ZJContentInfo>)content;
- 广告回调
ZJShortPlayAdDelegate
adCallbackDelegate
- (void)zj_shortplaySendAdRequest:(id<ZJContentInfo>)content;
- (void)zj_shortplayAdLoadSuccess:(id<ZJContentInfo>)content;
- (void)zj_shortplayAdLoadFail:(id<ZJContentInfo>)content error:(NSError *)error;
- (void)zj_shortplayAdFillFail:(id<ZJContentInfo>)content;
- (void)zj_shortplayAdWillShow:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoAdStartPlay:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoAdPause:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoAdContinue:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoAdOverPlay:(id<ZJContentInfo>)content;
- (void)zj_shortplayClickAdViewEvent:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoBufferEvent:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoRewardFinishEvent:(id<ZJContentInfo>)content;
- (void)zj_shortplayVideoRewardSkipEvent:(id<ZJContentInfo>)content;
- 业务接口回调
ZJShortPlayInterfaceDelegate
interfaceCallbackDelegate
- (void)zj_shortplayPlayletDetailUnlockFlowStart:(id<ZJContentInfo>)content;
- (void)zj_shortplayPlayletDetailUnlockFlowCancel:(id<ZJContentInfo>)content;
- (BOOL)zj_shortplayPlayletDetailCustomUnlockView;
* - success: 是否解锁成功
* - error: 解锁失败错误信息
*/
- (void)zj_shortplayPlayletDetailUnlockFlowEnd:(id<ZJContentInfo>)content
success:(BOOL)success
error:(NSError * _Nullable)error;
- (void)zj_shortplayClickEnterView:(id<ZJContentInfo>)content;
- (void)zj_shortplayNextPlayletWillPlay:(id<ZJContentInfo>)content;
- (UIView *)zj_shortplayPlayletDetailBottomBanner:(id<ZJContentInfo>)content;
- 自定义详情页cell试图回调
ZJShortPlayCustomViewDelegate
customViewCallBackDelegate
- (UIView *)zj_shortplayPlayletDetailCellCustomView:(UITableViewCell *)cell;
- (void)zj_shortplayPlayletDetailCell:(UITableViewCell *)cell updateCustomView:(UIView *)customView withPlayletData:(id)playletInfo;
- (void)zj_shortplayPlayletDetailCell:(UITableViewCell *)cell layoutSubviews:(UIView *)customView;
- (void)zj_shortplayPlayletDetailCell:(UITableViewCell *)cell afterLayoutSubviews:(UIView *)customView;
- 自定义Draw流的subview回调
ZJShortPlayCustomDrawAdViewDelegate
customDrawAdViewCallBackDelegate
- (UIView *)zj_shortplayDetailCellCreateAdView:(UITableViewCell *)cell adInputIndex:(NSUInteger)adIndex;
- (void)zj_shortplayDetailCell:(UITableViewCell *)cell bindDataToDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)zj_shortplayDetailCell:(UITableViewCell *)cell layoutSubview:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)zj_shortplayDetailCell:(UITableViewCell *)cell willDisplayDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)zj_shortplayDetailCell:(UITableViewCell *)cell didEndDisplayDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- 滑滑溜底部自定义Banner广告
ZJShortPlayDrawVideoViewControllerBannerDelegate
drawVideoViewBannerCallbackDelegate
- (UIView *)zj_shortplayDrawVideoVCBottomBannerView:(UIViewController *)vc;
- 短剧内容加载结果代理
ZJContentPageLoadCallBackDelegate
loadCallBackDelegate
- (void)zj_contentPageLoadSuccess;
- (void)zj_contentPageLoadFailure:(NSError *)error;
@interface ZJTubePageAd : ZJAd
@property (nonatomic, strong,nullable) ZJTubePageAdapter *currentAdapter;
@property (nonatomic, weak) id <ZJContentPageVideoStateDelegate> videoStateDelegate;
@property (nonatomic, weak) id <ZJContentPageStateDelegate> stateDelegate;
@property (nonatomic, weak) id <ZJContentPageLoadCallBackDelegate> loadCallBackDelegate;
@property (nonatomic, weak) id <ZJShortPlayPlayerDelegate> playerCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayAdDelegate> adCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayInterfaceDelegate> interfaceCallbackDelegate;
@property (nonatomic, weak) id <ZJShortPlayCustomViewDelegate> customViewCallBackDelegate;
@property (nonatomic, weak) id <ZJShortPlayCustomDrawAdViewDelegate> customDrawAdViewCallBackDelegate;
@property (nonatomic, weak) id <ZJShortPlayDrawVideoViewControllerBannerDelegate> drawVideoViewBannerCallbackDelegate;
@property (nonatomic, strong) ZJTubePageConfig *tubePageConfig;
- (UIViewController *)tubePageViewController;
@end
ZJTubePageConfig *config = [[ZJTubePageConfig alloc] init];
config.JSONConfigPath = [[NSBundle mainBundle] pathForResource:@"SDK_Setting_5434885" ofType:@"json"];
config.freeEpisodesCount = 5;
config.unlockEpisodesCountUsingAD = 5;
config.adType = ZJTubePageADTypeInterstitial;
config.posId = @"J7311893871";
config.showCloseButton = YES;
config.configOrNotCustomViewDelegate = YES;
config.configOrNotCustomDrawAdViewDelegate = YES;
config.configOrNotCustomBannerDelegate = YES;
config.customAdIndex = @[@0, @1];
self.tubePageAd = [[ZJTubePageAd alloc]initWithPlacementId:adId];
self.tubePageAd.tubePageConfig = config;
self.tubePageAd.videoStateDelegate = self;
self.tubePageAd.stateDelegate = self;
self.tubePageAd.loadCallBackDelegate = self;
self.tubePageAd.playerCallbackDelegate = self;
self.tubePageAd.adCallbackDelegate = self;
self.tubePageAd.interfaceCallbackDelegate = self;
self.tubePageAd.customViewCallBackDelegate = self;
self.tubePageAd.customDrawAdViewCallBackDelegate = self;
self.tubePageAd.drawVideoViewBannerCallbackDelegate = self;
[self.tubePageAd loadAd];
self.weakTubeVC = self.tubePageAd.tubePageViewController;
if (self.tubePageAd.currentAdapter.config.platformType == ZJAdPlatform_KS) {
[self addChildViewController:self.weakTubeVC];
[self.view addSubview:self.weakTubeVC.view];
} else {
[self presentViewController:self.weakTubeVC animated:YES completion:^{
}];
}