BUVideoAdView.h
3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//
// BUVideoAdView.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUPlayerPublicDefine.h"
#import "BUMaterialMeta.h"
@class BUMaterialMeta;
NS_ASSUME_NONNULL_BEGIN
/**
Control TikTok Audience Network video player.
*/
@protocol BUVideoEngine <NSObject>
/**
Get the already played time.
*/
- (CGFloat)currentPlayTime;
/**
Set video play when you support CustomMode
**/
- (void)play;
/**
Set video pause when you support CustomMode
**/
- (void)pause;
@end
@protocol BUVideoAdViewDelegate;
@interface BUVideoAdView : UIView<BUVideoEngine>
@property (nonatomic, weak, nullable) id<BUVideoAdViewDelegate> delegate;
/**
required. Root view controller for handling ad actions.
**/
@property (nonatomic, weak, readwrite) UIViewController *rootViewController;
/**
Whether to allow pausing the video by clicking, default NO. Only for draw video(vertical video ads).
**/
@property (nonatomic, assign) BOOL drawVideoClickEnable;
/**
AdType information.
*/
@property (nonatomic, assign) NSInteger AdType;
/**
material information.
*/
@property (nonatomic, strong, readwrite, nullable) BUMaterialMeta *materialMeta;
/**
Set your Video autoPlayMode when you support CustomMode
if support CustomMode , default autoplay Video
**/
@property (nonatomic, assign) BOOL supportAutoPlay;
- (instancetype)initWithMaterial:(BUMaterialMeta *)materialMeta;
/**
Resume to the corresponding time.
*/
- (void)playerSeekToTime:(CGFloat)time;
/**
Support configuration for pause button.
@param playImg : the image of the button
@param playSize : the size of the button. Set as cgsizezero to use default icon size.
*/
- (void)playerPlayIncon:(UIImage *)playImg playInconSize:(CGSize)playSize;
@end
@protocol BUVideoAdViewDelegate <NSObject>
@optional
/**
This method is called when videoadview failed to play.
@param error : the reason of error
*/
- (void)videoAdView:(BUVideoAdView *)videoAdView didLoadFailWithError:(NSError *_Nullable)error;
/**
This method is called when videoadview ready to play.
*/
- (void)playerReadyToPlay:(BUVideoAdView *)videoAdView;
/**
This method is called when videoadview playback status changed.
@param playerState : player state after changed
*/
- (void)videoAdView:(BUVideoAdView *)videoAdView stateDidChanged:(BUPlayerPlayState)playerState;
/**
This method is called when videoadview end of play.
*/
- (void)playerDidPlayFinish:(BUVideoAdView *)videoAdView;
/**
This method is called when videoadview is clicked.
*/
- (void)videoAdViewDidClick:(BUVideoAdView *)videoAdView;
/**
This method is called when videoadview's finish view is clicked.
*/
- (void)videoAdViewFinishViewDidClick:(BUVideoAdView *)videoAdView;
/**
This method is called when another controller has been closed.
@param interactionType : open appstore in app or open the webpage or view video ad details page.
*/
- (void)videoAdViewDidCloseOtherController:(BUVideoAdView *)videoAdView interactionType:(BUInteractionType)interactionType;
@end
NS_ASSUME_NONNULL_END