CSJRewardedVideoTopBarView.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // CSJRewardedVideoTopBarView.h
  3. // CSJAdSDK
  4. //
  5. // Created by cuiyanan on 2019/10/15.
  6. // Copyright © 2019 bytedance. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class CSJURitSettingModel;
  10. typedef NS_ENUM(NSInteger, BUTopBarStyle) {
  11. BUTopBarStyle_rewardNormal = 1,// 普通激励视频样式
  12. BUTopBarStyle_fullScreenNormal = 2,// 普通全屏视频样式
  13. BUTopBarStyle_dislike = 3,// 含有dislike的样式
  14. BUTopBarStyle_fullScreenImage = 4,// 全屏图片,只有倒计时关闭
  15. BUTopBarStyle_fullScreenImage_dislike = 5,// 全屏图片,dislike和倒计时关闭
  16. BUTopBarStyle_intersititalImage = 6,// 插屏图片,只有关闭
  17. BUTopBarStyle_intersititalImage_dislke = 7,// 插屏图片,只有dislike和关闭
  18. BUTopBarStyle_rewardDraw = 8, // 激励Draw流
  19. };
  20. typedef NS_ENUM(NSInteger, BUTopBarSilentStatus) {
  21. BUTopBarSilentStatus_slient = 1,// 静音按钮静音
  22. BUTopBarSilentStatus_unslient = 2,// 静音按钮有声音
  23. };
  24. NS_ASSUME_NONNULL_BEGIN
  25. @protocol CSJRewardedVideoTopBarDelegate <NSObject>
  26. // 点击视频区域
  27. - (void)videoTopBarTapped:(id)sender extraDic:(NSDictionary *)extraDic;
  28. // 点击静音按钮
  29. - (void)videoTopBarSilentButtonTapped:(id)sender;
  30. // 点击关闭按钮
  31. - (void)videoTopBarCloseButtonTapped:(id)sender;
  32. // 点击负反馈按钮
  33. - (void)videoTopBarDislikeButtonTapped:(id)sender;
  34. // 根据具体业务解决是否展示X
  35. - (BOOL)videoTopBarCloseButtonShowCloseIcon;
  36. @end
  37. @interface CSJRewardedVideoTopBarView : UIView
  38. @property (nonatomic, weak) id <CSJRewardedVideoTopBarDelegate> delegate;
  39. @property (nonatomic, assign, readonly) long currentSecond;//当前倒计时剩余秒数
  40. // 负反馈按钮
  41. @property (nonatomic, strong, readonly) UIButton *dislikeButton;
  42. @property (nonatomic, assign) BOOL forceShowSkip; //强制展示跳过
  43. - (instancetype)initWithFrame:(CGRect)frame isRewardedVideo:(BOOL)isRewardedVideo style:(BUTopBarStyle)style ritModel:(CSJURitSettingModel *)ritModel materialMeta:(CSJMaterialMeta *)materialMeta;
  44. // 更新倒计时
  45. - (void)updateCountButtonWithSecond:(long)second totalDuration:(long)duration;
  46. // 更新静音按钮状态
  47. - (void)updateSilentButtonStatus:(BUTopBarSilentStatus)status;
  48. // 更新奖励剩余时间
  49. - (void)updateRewardLeftSeconds:(NSInteger)countDown;
  50. @end
  51. NS_ASSUME_NONNULL_END