短剧
@interface SYTubePageAd : SYTierAd
@property (nonatomic, strong,nullable) SYTubePageAdapter *currentAdapter;
@property (nonatomic, weak) id <SYContentPageVideoStateDelegate> videoStateDelegate;
@property (nonatomic, weak) id <SYContentPageStateDelegate> stateDelegate;
@property (nonatomic, weak) id <SYContentPageLoadCallBackDelegate> loadCallBackDelegate;
@property (nonatomic, weak) id <SYShortPlayPlayerDelegate> playerCallbackDelegate;
@property (nonatomic, weak) id <SYShortPlayAdDelegate> adCallbackDelegate;
@property (nonatomic, weak) id <SYShortPlayInterfaceDelegate> interfaceCallbackDelegate;
@property (nonatomic, weak) id <SYShortPlayCustomViewDelegate> customViewCallBackDelegate;
@property (nonatomic, weak) id <SYShortPlayCustomDrawAdViewDelegate> customDrawAdViewCallBackDelegate;
@property (nonatomic, weak) id <SYShortPlayDrawVideoViewControllerBannerDelegate> drawVideoViewBannerCallbackDelegate;
@property (nonatomic, strong) SYTubePageConfig *tubePageConfig;
- (UIViewController *)tubePageViewController;
@end
typedef NS_ENUM(NSInteger, SY_TubePageVideoProgressBarStyle) {
SY_TubePageVideoProgressBarStyleLightContent = 0,
SY_TubePageVideoProgressBarStyleDarkContent = 1
};
typedef NS_ENUM(NSInteger, SY_TubePageDrawVideoVCTabOptions) {
SY_TubePageDrawVideoVCTabOptions_playlet = 1 << 0,
SY_TubePageDrawVideoVCTabOptions_playlet_feed = 1 << 1,
SY_TubePageDrawVideoVCTabOptions_theater = 1 << 2,
};
typedef NS_ENUM(NSInteger, SY_TubePageADType) {
SY_TubePageADTypeInterstitial = 0,
SY_TubePageADTypeRewardVideo = 1,
};
@interface SYTubePageConfig : NSObject
@property (nonatomic, copy) NSString *JSONConfigPath;
@property (nonatomic, assign) BOOL showCloseButton;
@property (nonatomic, assign) BOOL hiddenGuideGeste;
@property (nonatomic, assign) CGSize viewSize;
@property (nonatomic, assign) CGFloat out_bottomOffset;
@property (nonatomic, assign) CGFloat inner_playPlet_bottomOffset;
@property (nonatomic, assign) SY_TubePageVideoProgressBarStyle progressBarStyle;
@property (nonatomic, assign) BOOL hiddenPlayletEnterView;
@property (nonatomic, assign) BOOL enterPlayPageUsePush;
@property (nonatomic, assign) NSInteger freeEpisodesCount;
@property (nonatomic, assign) NSInteger unlockEpisodesCountUsingAD;
@property (nonatomic) BOOL hideLikeIcon;
@property (nonatomic) BOOL hideCollectIcon;
@property (nonatomic, assign) NSInteger playletFreeCount;
@property (nonatomic) BOOL disableDoubleClickLike;
@property (nonatomic) BOOL disableLongPressSpeed;
@property (nonatomic, copy, nullable) NSArray<NSNumber *> *customAdIndex;
@property (nonatomic, assign) SY_TubePageDrawVideoVCTabOptions drawVCTabOptions;
@property (nonatomic, assign) BOOL shouldHideTabBarView;
@property (nonatomic, assign) BOOL configOrNotCustomViewDelegate;
@property (nonatomic, assign) BOOL configOrNotCustomDrawAdViewDelegate;
@property (nonatomic, assign) BOOL configOrNotCustomBannerDelegate;
@property (nonatomic, assign) SY_TubePageADType adType;
@property (nonatomic, copy) NSString *posId;
@end
- 视频状态代理
SYContentPageVideoStateDelegate videoStateDelegate;
@optional
* 视频开始播放
* @param videoContent 内容模型
*/
- (void)sy_videoDidStartPlay:(id<SYContentInfo>)videoContent;
* 视频暂停播放
* @param videoContent 内容模型
*/
- (void)sy_videoDidPause:(id<SYContentInfo>)videoContent;
* 视频恢复播放
* @param videoContent 内容模型
*/
- (void)sy_videoDidResume:(id<SYContentInfo>)videoContent;
* 视频停止播放
* @param videoContent 内容模型
* @param finished 是否播放完成
*/
- (void)sy_videoDidEndPlay:(id<SYContentInfo>)videoContent isFinished:(BOOL)finished;
* 视频播放失败
* @param videoContent 内容模型
* @param error 失败原因
*/
- (void)sy_videoDidFailedToPlay:(id<SYContentInfo>)videoContent withError:(NSError *)error;
- 页面状态代理
SYContentPageStateDelegate stateDelegate
* 内容展示
* @param content 内容模型
*/
- (void)sy_contentDidFullDisplay:(id<SYContentInfo>)content;
* 内容隐藏
* @param content 内容模型
*/
- (void)sy_contentDidEndDisplay:(id<SYContentInfo>)content;
* 内容暂停显示,ViewController disappear或者Application resign active
* @param content 内容模型
*/
- (void)sy_contentDidPause:(id<SYContentInfo>)content;
* 内容恢复显示,ViewController appear或者Application become active
* @param content 内容模型
*/
- (void)sy_contentDidResume:(id<SYContentInfo>)content;
- (void)sy_adapter_contentTaskComplete:(id<SYContentInfo>)content;
- 短剧播放器回调
SYShortPlayPlayerDelegate playerCallbackDelegate
- (void)sy_shortplayDrawVideoCurrentVideoChanged:(NSInteger)index adapter:(id<SYContentInfo>)content;
- (void)sy_shortplayDrawVideoDidClickedErrorButtonRetry:(id<SYContentInfo>)content;
- (void)sy_shortplayDrawVideoCloseButtonClicked:(id<SYContentInfo>)content;
- (void)sy_shortplayDrawVideoDataRefreshCompletion:(NSError *)error content:(id<SYContentInfo>)content;
- (void)sy_shortplayPageViewControllerSwitchToIndex:(NSInteger)index content:(id<SYContentInfo>)content;
- (UIView *)sy_shortplayDrawVideoVCBottomBannerView:(UIViewController *)vc content:(id<SYContentInfo>)content;
- 广告回调
SYShortPlayAdDelegate adCallbackDelegate
- (void)sy_shortplaySendAdRequest:(id<SYContentInfo>)content;
- (void)sy_shortplayAdLoadSuccess:(id<SYContentInfo>)content;
- (void)sy_shortplayAdLoadFail:(id<SYContentInfo>)content error:(NSError *)error;
- (void)sy_shortplayAdFillFail:(id<SYContentInfo>)content;
- (void)sy_shortplayAdWillShow:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoAdStartPlay:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoAdPause:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoAdContinue:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoAdOverPlay:(id<SYContentInfo>)content;
- (void)sy_shortplayClickAdViewEvent:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoBufferEvent:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoRewardFinishEvent:(id<SYContentInfo>)content;
- (void)sy_shortplayVideoRewardSkipEvent:(id<SYContentInfo>)content;
- 业务接口回调
SYShortPlayInterfaceDelegate interfaceCallbackDelegate
- (void)sy_shortplayPlayletDetailUnlockFlowStart:(id<SYContentInfo>)content;
- (void)sy_shortplayPlayletDetailUnlockFlowCancel:(id<SYContentInfo>)content;
- (BOOL)sy_shortplayPlayletDetailCustomUnlockView;
* - success: 是否解锁成功
* - error: 解锁失败错误信息
*/
- (void)sy_shortplayPlayletDetailUnlockFlowEnd:(id<SYContentInfo>)content
success:(BOOL)success
error:(NSError * _Nullable)error;
- (void)sy_shortplayClickEnterView:(id<SYContentInfo>)content;
- (void)sy_shortplayNextPlayletWillPlay:(id<SYContentInfo>)content;
- (UIView *)sy_shortplayPlayletDetailBottomBanner:(id<SYContentInfo>)content;
- 自定义详情页cell试图回调
SYShortPlayCustomViewDelegate customViewCallBackDelegate
- (UIView *)sy_shortplayPlayletDetailCellCustomView:(UITableViewCell *)cell;
- (void)sy_shortplayPlayletDetailCell:(UITableViewCell *)cell updateCustomView:(UIView *)customView withPlayletData:(id)playletInfo;
- (void)sy_shortplayPlayletDetailCell:(UITableViewCell *)cell layoutSubviews:(UIView *)customView;
- (void)sy_shortplayPlayletDetailCell:(UITableViewCell *)cell afterLayoutSubviews:(UIView *)customView;
- 自定义Draw流的subview回调
SYShortPlayCustomDrawAdViewDelegate customDrawAdViewCallBackDelegate
- (UIView *)sy_shortplayDetailCellCreateAdView:(UITableViewCell *)cell adInputIndex:(NSUInteger)adIndex;
- (void)sy_shortplayDetailCell:(UITableViewCell *)cell bindDataToDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)sy_shortplayDetailCell:(UITableViewCell *)cell layoutSubview:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)sy_shortplayDetailCell:(UITableViewCell *)cell willDisplayDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- (void)sy_shortplayDetailCell:(UITableViewCell *)cell didEndDisplayDrawAdView:(UIView *)drawAdView adInputIndex:(NSUInteger)adIndex;
- 滑滑溜底部自定义Banner广告
SYShortPlayDrawVideoViewControllerBannerDelegate drawVideoViewBannerCallbackDelegate
- (UIView *)sy_shortplayDrawVideoVCBottomBannerView:(UIViewController *)vc;
- 短剧内容加载结果代理
SYContentPageLoadCallBackDelegate loadCallBackDelegate
- (void)sy_contentPageLoadSuccess;
- (void)sy_contentPageLoadFailure:(NSError *)error;
SYTubePageConfig *config = [[SYTubePageConfig alloc] init];
config.JSONConfigPath = [[NSBundle mainBundle] pathForResource:@"SDK_Setting_5434885" ofType:@"json"];
config.freeEpisodesCount = 5;
config.unlockEpisodesCountUsingAD = 5;
config.adType = SYTubePageADTypeInterstitial;
config.posId = @"J7311893871";
config.showCloseButton = YES;
self.tubePageAd = [[SYTubePageAd 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 == SY_AdPlatform_KS) {
[self addChildViewController:self.weakTubeVC];
[self.view addSubview:self.weakTubeVC.view];
} else {
[self presentViewController:self.weakTubeVC animated:YES completion:^{
}];
}