BGLiveUIViewController.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. //
  2. // BGLiveUIViewController.h
  3. // BugoLive
  4. //
  5. // Created by xfg on 16/11/23.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. // 直播UI层
  8. //#import "AuctionTool.h"
  9. #import "BGConversationSegmentController.h"
  10. #import "BGConversationServiceController.h"
  11. #import "BGLivePayManager.h"
  12. #import "SHomePageVC.h"
  13. #import "TCShowLiveView.h"
  14. #import <UIKit/UIKit.h>
  15. #import "GameModel.h"
  16. #import "PKUserListViewController.h"
  17. #import "BGKSYPlayerControllerForPk.h"
  18. #import "FPKProgress.h"
  19. #import "FPKCountDownView.h"
  20. #import "MGLiveWishView.h"
  21. #import "MGShowVIPListView.h"
  22. #import "BGSoundEffectsView.h"
  23. //#import "TiUIView.h"
  24. #import "BogoShopExplainView.h"
  25. #import "BGSoundEffectModel.h"
  26. #import "choseMuiscVC.h"
  27. @class BGLiveUIViewController;
  28. @protocol FWLiveUIViewControllerServeiceDelegate <NSObject>
  29. @required
  30. /**
  31. 显示充值界面
  32. @param liveUIViewController self
  33. */
  34. - (void)showRechargeView:(BGLiveUIViewController *)liveUIViewController;
  35. /**
  36. 显示音效设置界面
  37. */
  38. - (void)showSoundSetView:(BGLiveUIViewController *)liveUIViewController;
  39. /**
  40. 显示音效设置界面
  41. */
  42. - (void)shoSVipView:(BGLiveUIViewController *)liveUIViewController;
  43. /**
  44. 关闭当前直播
  45. @param isDirectCloseLive 是否直接关闭
  46. @param isHostShowAlert 主播是否弹出Alert
  47. */
  48. - (void)closeCurrentLive:(BOOL)isDirectCloseLive isHostShowAlert:(BOOL)isHostShowAlert;
  49. -(void)pkController:(int )type WidthData:(id)obj;
  50. - (void)protocolDidScrollView:(BGTLiveScrollView *)scrollView isRefreshLive:(BOOL)isRefresh;
  51. - (void)protocolGetVideoWithRoomID:(NSString *)roomID;
  52. //点击了表情
  53. - (void)protocolDidClickEmoji:(NSString *)emoji;
  54. @end
  55. @interface BGLiveUIViewController : BGBaseViewController<FWChatVCDelegate, UIGestureRecognizerDelegate,UIScrollViewDelegate, TCShowLiveViewForUIDelegate>
  56. //,TiUIViewDelegate>
  57. {
  58. __weak id<FWShowLiveRoomAble> _liveItem; // 开启、观看直播传入的实体
  59. id<FWLiveControllerAble> _liveController; // 当前SDK控制类
  60. BOOL _showingRight; // 判断是否正在显示LivingView
  61. BOOL _isFromeLeft; // 判断是否从左往右滑动
  62. BOOL _isFromeTop; // 判断是否从上往下滑动
  63. BOOL _isLeftOrRightPan; // 判断是否左右方向滑动的幅度大于上线方向
  64. BOOL _isHost; // 是否主播
  65. }
  66. @property (nonatomic, weak) id<FWLiveUIViewControllerServeiceDelegate> serviceDelegate;
  67. // 左右滑动层
  68. @property (nonatomic, strong) TCShowLiveView *liveView;
  69. //上下滑动
  70. @property(nonatomic, strong) BGTLiveScrollView *liveScrollView;
  71. // 记录 是否加载半屏幕 VC
  72. @property (nonatomic, assign) BOOL isHaveHalfIMChatVC;
  73. // 记录 是否加载半屏幕 VC
  74. @property (nonatomic, assign) BOOL isHaveHalfIMMsgVC;
  75. // 记录 是否加载半屏幕 VC 键盘类型 1文本 2表情 3更多
  76. @property (nonatomic, assign) int isKeyboardTypeNum;
  77. // 半屏幕 VC背景
  78. @property (nonatomic, strong) UIView *imChatVCBgView;
  79. // 滑动手势
  80. @property (nonatomic, strong) UIPanGestureRecognizer *panGestureRec;
  81. // 付费直播的控制类
  82. @property (nonatomic, strong) BGLivePayManager *livePay;
  83. // 付费直播心跳返回的字典
  84. @property (nonatomic, strong) NSDictionary *currentMonitorDict;
  85. // 付费直播显示看视频的倒计时的label
  86. @property (nonatomic, strong) UILabel *livePayLabel;
  87. // 付费直播倒计时的time
  88. @property (nonatomic, strong) NSTimer *livePayTimer;
  89. // 按时付费直播倒计时剩余时间的定时器
  90. @property (nonatomic, strong) NSTimer *livePayLeftTimer;
  91. // 按时付费直播倒计时剩余时间的时间
  92. @property (nonatomic, assign) int livePayLeftCount;
  93. // 付费直播的类型0按时1按场
  94. @property (nonatomic, assign) int payLiveType;
  95. // 可免费观看的时长
  96. @property (nonatomic, assign) int livePayCount;
  97. @property(nonatomic, strong) BGKSYPlayerControllerForPk *pkView;
  98. @property (nonatomic, strong) FPKProgress *fpkProgress;
  99. @property (nonatomic, strong) FPKCountDownView *pkCountDownView;
  100. //心愿单
  101. @property(nonatomic, strong) MGLiveWishView *wishView;
  102. //音效设置
  103. @property(nonatomic, strong) BGSoundEffectsView *soundSetView;
  104. //贵族中心
  105. @property(nonatomic, strong) MGShowVIPListView *vipView;
  106. //商品讲解
  107. @property(nonatomic, strong) BogoShopExplainView *shopExplainView;
  108. //2020-1-4 PK结束后
  109. @property (nonatomic,weak) UIView *showView;
  110. //pk对方id
  111. @property(nonatomic, strong) NSString *otherId;
  112. //对方主播头像地址
  113. @property(nonatomic, strong) NSString *avatar;
  114. @property(nonatomic,strong) NSString *myavatar;
  115. @property(nonatomic,strong) NSString *myId;
  116. @property(nonatomic, assign) BOOL isLianMaiing;
  117. @property(nonatomic, assign) BOOL isVoice;
  118. @property(nonatomic, copy) void (^playUrlBlock)(BGSoundEffectModel *model);
  119. /**
  120. 初始化房间信息等
  121. @param liveItem 房间信息
  122. @param liveController 直播VC
  123. @return self
  124. */
  125. - (instancetype)initWith:(id<FWShowLiveRoomAble>)liveItem liveController:(id<FWLiveControllerAble>)liveController;
  126. /**
  127. 请求完接口后,刷新直播间相关信息
  128. @param liveItem 视频Item
  129. @param liveInfo get_video2接口获取下来的数据实体
  130. */
  131. - (void)refreshLiveItem:(id<FWShowLiveRoomAble>)liveItem liveInfo:(CurrentLiveInfo *)liveInfo;
  132. /**
  133. 进入付费直播
  134. @param responseJson get_video2接口返回的数据
  135. @parma closeBtn 关闭按钮
  136. */
  137. - (void)beginEnterPayLive:(NSDictionary *)responseJson closeBtn:(UIButton *)closeBtn;
  138. /**
  139. 收到IM消息,调起付费
  140. @param type 付费类型
  141. @param closeBtn 关闭按钮
  142. */
  143. - (void)getVedioViewWithType:(int)type closeBtn:(UIButton *)closeBtn;
  144. /**
  145. 心跳唤起付费界面
  146. @param responseJson 心跳接口返回数据
  147. */
  148. - (void)createPayLiveView:(NSDictionary *)responseJson;
  149. /**
  150. 插件中心点击付费
  151. @param model Model
  152. */
  153. - (void)clickPluginPayItem:(GameModel *)model closeBtn:(UIButton *)closeBtn;
  154. /**
  155. 显示按时付费在倒计时的页面
  156. */
  157. - (void)dealLivepayTComfirm;
  158. - (void)addTwoSubVC;
  159. - (void)showFace;
  160. - (void)showMusic;
  161. // 移除滑动手势
  162. - (void)removePanGestureRec;
  163. // 设置当前是否能够使用滑动手势
  164. - (void)setPanGesture:(BOOL)isEnabled;
  165. // 开始直播
  166. - (void)startLive;
  167. // 暂停直播
  168. - (void)pauseLive;
  169. // 重新开始直播
  170. - (void)resumeLive;
  171. // 结束直播
  172. - (void)endLive;
  173. //显示pk列表
  174. -(void)showPKlist;
  175. -(void)hiddenPKlist;
  176. //显示心愿view
  177. -(void)showWishView;
  178. //显示pkView
  179. -(void)pkViewWith:(NSString *)uid;
  180. -(void)pkVivewHidden;
  181. //2020-1-4 pk结束
  182. -(void)pkVivewEnd:(NSString *)win_user_id anddic:(NSDictionary *)dic;
  183. -(void)pkViewUpdateData:(NSDictionary *)dic;
  184. - (void)switchToPunish:(int)time;
  185. - (void)receiveCanclePk;
  186. - (void)receiveRejectPkWithMsg:(NSString *)msg;
  187. - (void)requestUserInfo;
  188. //隐藏对话框
  189. - (void)ChatVCBgViewTap;
  190. @property(nonatomic, strong) choseMuiscVC *musicVC;
  191. @end