BGLivePayManager.h 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // BGLivePayManager.h
  3. // BuguLive
  4. //
  5. // Created by 丁凯 on 2017/8/16.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "LivePayLeftPromptV.h"
  10. #import "TCShowLiveView.h"
  11. @protocol livePayDelegate <NSObject>
  12. //付费直播是否加载直播间视频的代理
  13. - (void)livePayLoadVedioIsComfirm:(BOOL)isComfirm;
  14. @end
  15. @interface BGLivePayManager : NSObject
  16. @property (nonatomic, strong) NetHttpsManager *httpsManager; //网络请求
  17. @property (nonatomic, strong) GlobalVariables *BuguLive; //本地全局单例
  18. @property (nonatomic, strong) TCShowLiveView *subLiving; //直播间传下来的living
  19. @property (nonatomic, strong) LivePayLeftPromptV *hostLeftPView; //主播左边信息的view
  20. @property (nonatomic, strong) LivePayLeftPromptV *audienceLeftPView; //观众左边信息的view
  21. @property (nonatomic, strong) UIView *shadowView; //直播需要收费,却没有没有钻石的覆盖的view
  22. @property (nonatomic, strong) NSTimer *hostPayLiveTime; //主播付费倒计时
  23. @property (nonatomic, strong) NSTimer *payLiveTime; //付费模式下的定时器
  24. @property (nonatomic, strong) NSTimer *countDownTime; //倒计时的定时器
  25. @property (nonatomic, strong) NSDictionary *hostDict; //存储观众点击确认付费的字典
  26. @property (nonatomic, strong) NSDictionary *audienceDict; //主播存储的字典
  27. @property (nonatomic, strong) UIButton *closeButton; //关闭直播间的按钮
  28. @property (nonatomic, strong) UIViewController *livController; //直播间的view
  29. @property (nonatomic, assign) NSInteger roomId; //直播间房间id
  30. @property (nonatomic, assign) NSInteger live_fee; //付费直播 收费多少 (在付费模式下有效)
  31. @property (nonatomic, assign) NSInteger live_pay_type; //收费类型 0按时收费,1按场次收费
  32. @property (nonatomic, assign) NSInteger count_down; //倒计时(秒)
  33. @property (nonatomic, assign) NSInteger timeCount; //定时器的count
  34. @property (nonatomic, assign) NSInteger hostTimeCount; //主播定时器的count
  35. @property (nonatomic, assign) NSInteger downTimeType; //收费倒计时的类型1IM倒计时2为get_Video接口的倒计时
  36. @property (nonatomic, assign) NSInteger is_mentionType; //提档参数 1提档,0不提档
  37. @property (nonatomic, assign) NSInteger liveType; //(等于40是按场次付费)
  38. @property (nonatomic, assign) NSInteger buttomFunctionType; //直播类型(等于40是按场次付费)
  39. @property (nonatomic, assign) BOOL isEnterPayLive; //判断观众是否在付费直播 1是 0不是
  40. @property (nonatomic, assign) BOOL is_agree; //是否同意收费 1为yes 0 为no
  41. @property (nonatomic, copy) void (^block) (NSString *string); //string 1代表跳转到充值页面 2代表退出直播间
  42. @property (nonatomic, strong) MMAlertView *myAlertView1; //观众进入直播间确定的弹窗提示
  43. @property (nonatomic, strong) MMAlertView *myAlertView2; //观众在付费直播间钱不够5分钟的弹窗提示
  44. @property (nonatomic, strong) MMAlertView *myAlertView3; //观众在付费直播间钱不够的弹窗提示
  45. @property (nonatomic, weak) id<livePayDelegate> payDelegate; //付费直播的代理加载视频等操作 MMAlertView
  46. #pragma mark ===================================================主播开放方法===========================================================
  47. /*
  48. 1.liveView 直播间传下来的TCShowLiveView
  49. 2.roomEngine 通过这个可知道当前的roomId,从房间传下来的
  50. 3.dict 主播心跳或者观众get_video返回获取的字典
  51. 4.payType 收费类型
  52. */
  53. - (id)initWithLiveView:(TCShowLiveView *)liveView andRoomId:(int)roomId andhostDict:(NSDictionary *)hostDict andpayType:(NSInteger)payType;
  54. //主播心跳接口之后走的方法
  55. - (void)creatViewWithDict:(NSDictionary *)dict;
  56. //提档或者切换付费按钮后的结果 count=1按时付费 count=2提档 count=3按场付费
  57. - (void)creatPriceViewWithCount:(int)count;
  58. //主播由于某些原因突然退出直播间,再次进入直播间还有原来的付费直播的情况
  59. - (void)hostEnterLiveAgainWithMDict:(NSDictionary *)responseJson;
  60. #pragma mark ====================================================观众开放方法===========================================================
  61. /*
  62. 1.controller 直播间的控制器
  63. 2.liveView 直播间传下来的TCShowLiveView
  64. 3.roomEngine 通过这个可知道当前的roomId,从房间传下来的
  65. 4.dict 主播心跳或者观众get_video返回获取的字典
  66. 5.closeBtn 直播间的关闭button
  67. */
  68. - (id)initWithController:(UIViewController *)controller andLiveView:(TCShowLiveView *)liveView andRoomId:(int)roomId andAudienceDict:(NSDictionary *)audienceDict andButton:(UIButton *)closeBtn;
  69. //IM推送消息后观众之后走的方法
  70. - (void)AudienceGetVedioViewWithType:(int)typeTag;
  71. //按场付费直播观众在主播开启付费之后进入直播间变灰
  72. - (void)AudienceBecomeshadowView;
  73. //进入收费直播间
  74. - (void)enterMoneyMode;
  75. //观众进入直播间只听声音不看画面要覆盖一层view
  76. - (void)creatShadowView;
  77. #pragma mark ================================================主播和观众共用开放方法=======================================================
  78. //改变左边提示的frame isHost是否是主播 imgView 竞拍最高价的view bankerView游戏的view
  79. - (void)changeLeftViewFrameWithIsHost:(BOOL)isHost andAuctionView:(UIView *)auctionView andBankerView:(UIView *)bankerView;
  80. @end