123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- //
- // 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
|