TCShowLiveTopView.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. //
  2. // TCShowLiveTopView.h
  3. // TCShow
  4. //
  5. // Created by AlexiChen on 16/4/14.
  6. // Copyright © 2016年 AlexiChen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "UserModel.h"
  10. #import "AudienceEnteringTipView.h"
  11. @interface TCShowLiveTimeView : UIView
  12. {
  13. @protected
  14. MenuButton *_hostHeadBtn;
  15. UIImageView *_hostVImgView;
  16. UILabel *_liveTitle;
  17. UILabel *_liveAudience;
  18. BOOL _isHost; // 是否主播
  19. }
  20. @property (nonatomic, readonly) MenuButton *hostHeadBtn; // 主播头像
  21. @property (nonatomic, readonly) UIImageView *hostVImgView; // 主播认证图标
  22. @property (nonatomic, readonly) UILabel *liveTitle; // 直播Live
  23. @property (nonatomic, readonly) UILabel *liveAudience; // 观众数
  24. @property (nonatomic, strong) UIButton *liveFollow; // 关注按钮
  25. @property (nonatomic, assign) NSInteger watchNumber; // 观众数量
  26. @property (nonatomic, weak) id<FWShowLiveRoomAble> liveItem;
  27. @property(nonatomic, strong) UILabel *roomId;
  28. /**
  29. 初始化房间信息等
  30. @param liveItem 房间信息
  31. @param liveController 直播VC
  32. @return self
  33. */
  34. - (instancetype)initWith:(id<FWShowLiveRoomAble>)liveItem liveController:(id<FWLiveControllerAble>)liveController;
  35. /**
  36. 请求完接口后,刷新直播间相关信息
  37. @param liveItem 视频Item
  38. @param liveInfo get_video2接口获取下来的数据实体
  39. */
  40. - (void)refreshLiveItem:(id<FWShowLiveRoomAble>)liveItem liveInfo:(CurrentLiveInfo *)liveInfo;
  41. - (void)onImUsersEnterLive;
  42. - (void)onImUsersExitLive;
  43. @end
  44. //==========================================================
  45. @class TCShowLiveTopView;
  46. @protocol TCShowLiveTopViewDelegate <NSObject>
  47. @optional
  48. // 点击用户头像
  49. - (void)onTopView:(TCShowLiveTopView *)topView userModel:(UserModel *)userModel;
  50. // 点击关注按钮
  51. - (void)followAchor:(TCShowLiveTopView *)topView;
  52. // 进入印票排行榜
  53. - (void)goToContributionList:(TCShowLiveTopView *)topView;
  54. // 进入守护排行榜
  55. - (void)goToWardPopView:(TCShowLiveTopView *)topView;
  56. // 点击VIP
  57. - (void)goToVipPopView:(TCShowLiveTopView *)topView;
  58. // 最新点击+ -跳转
  59. - (void)onTopView:(TCShowLiveTopView *)topView andCount:(int)count;
  60. // ykk 控制半VC退出
  61. - (void)clickTopViewUserHeaderMustQuitAllHalfVC:(TCShowLiveTopView*)topView;
  62. -(void)userlistRefresh;
  63. @end
  64. @protocol TCShowLiveTopViewToSDKDelegate <NSObject>
  65. @required
  66. // 推拉流请求所的码率
  67. - (void)refreshKBPS:(TCShowLiveTopView *)topView;
  68. @end
  69. @interface TCShowLiveTopView : UIView<UICollectionViewDataSource,UICollectionViewDelegate>
  70. {
  71. @protected
  72. TCShowLiveTimeView *_timeView;
  73. UICollectionView *_collectionView;
  74. UILabel *_ticketNameLabel;
  75. UIImageView *_moreImgView;
  76. UIImageView *_moreWardImgView;
  77. UIImageView *_numRightImgView;//右边人气值
  78. UILabel *_numRightTitleL;//右边人气数值
  79. UILabel *_numRightSubTitleL;//右边人气数值描述
  80. __weak id<FWShowLiveRoomAble> _liveItem; // 开启、观看直播传入的实体
  81. NetHttpsManager *_httpManager;
  82. NSTimer *_liveRateTimer; // 刷新当前推拉流请求所的码率定时器
  83. BOOL _isHost; // 是否主播
  84. NSString *_groupIdStr; // 群聊ID
  85. }
  86. @property (nonatomic, readonly) TCShowLiveTimeView *timeView;
  87. @property (nonatomic, strong) UICollectionView *collectionView;
  88. @property (nonatomic, weak) id<TCShowLiveTopViewDelegate> toServicedelegate;
  89. @property (nonatomic, weak) id<TCShowLiveTopViewToSDKDelegate> toSDKDelegate;
  90. @property (nonatomic, copy) NSString *is_private; // 是否是私密
  91. @property (nonatomic, strong) NSMutableArray *userArray; // 用户列表
  92. @property (nonatomic, assign) int has_admin; // 通过这个成员变量来判断是否是管理员(判断是否有加减号)
  93. @property (nonatomic, assign) BOOL isShowFollowBtn; // 是否显示关注按钮
  94. // 账号
  95. @property (nonatomic, strong) UILabel *accountLabel;
  96. // 印票
  97. @property (nonatomic, strong) UIView *otherContainerView;
  98. // 守护
  99. @property (nonatomic, strong) UIView *wardContainerView;
  100. @property (nonatomic, strong) UILabel *ticketNumLabel; // 印票数
  101. @property (nonatomic, strong) UILabel *wardNumLabel; //守护数
  102. @property (nonatomic, strong) UIButton *wardBtn;//贵族按钮
  103. @property (nonatomic, strong) UIButton *vipBtn;//VIP按钮
  104. // 推拉流码率
  105. @property (nonatomic, strong) UIView *kbpsContainerView;
  106. @property (nonatomic, strong) UILabel *kbpsRecvLabel;
  107. @property (nonatomic, strong) UILabel *kbpsSendLabel;
  108. // 最高价(竞拍)
  109. @property (nonatomic, strong) UILabel *titleNameLabel;
  110. @property (nonatomic, strong) UILabel *priceLabel;
  111. @property (nonatomic, strong) UIView *priceView;
  112. @property (nonatomic, strong) UIImageView *otherMoreView;
  113. @property(nonatomic, copy) void (^clickVipBlock)(BOOL isClick);
  114. @property (nonatomic, strong) NSDictionary *wardJson;
  115. //获取守护列表数据
  116. - (void)requestWardData;
  117. /**
  118. 初始化房间信息等
  119. @param liveItem 房间信息
  120. @param liveController 直播VC
  121. @return self
  122. */
  123. - (instancetype)initWith:(id<FWShowLiveRoomAble>)liveItem liveController:(id<FWLiveControllerAble>)liveController;
  124. /**
  125. 请求完接口后,刷新直播间相关信息
  126. @param liveItem 视频Item
  127. @param liveInfo get_video2接口获取下来的数据实体
  128. */
  129. - (void)refreshLiveItem:(id<FWShowLiveRoomAble>)liveItem liveInfo:(CurrentLiveInfo *)liveInfo;
  130. // 观众进入直播间
  131. - (void)onImUsersEnterLive:(UserModel *)userModel;
  132. // 观众退出直播间
  133. - (void)onImUsersExitLive:(UserModel *)userModel;
  134. // 更新otherContainerView的frame
  135. - (void)relayoutOtherContainerViewFrame;
  136. /**
  137. 首次获取观众列表
  138. @param responseJson get_video接口的数据
  139. */
  140. - (void)refreshAudienceList:(NSDictionary *)responseJson;
  141. /**
  142. 初始化观众数量、列表
  143. @param watch_number 观众数量
  144. */
  145. - (void)setupLiveAudience:(NSString *)watch_number;
  146. /**
  147. 刷新观众列表
  148. @param customMessageModel Model
  149. */
  150. - (void)refreshLiveAudienceList:(CustomMessageModel *)customMessageModel;
  151. /**
  152. 刷新印票数量
  153. @param ticketCount 印票数量
  154. */
  155. - (void)refreshTicketCount:(NSString *)ticketCount;
  156. //刷新人气值
  157. - (void)refreshHostNumCount:(NSString *)numCount;
  158. // 开始直播
  159. - (void)startLive;
  160. // 暂停直播
  161. - (void)pauseLive;
  162. // 重新开始直播
  163. - (void)resumeLive;
  164. // 结束直播
  165. - (void)endLive;
  166. @end