AppAble.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. //
  2. // AppAble.h
  3. // BugoLive
  4. //
  5. // Created by xfg on 16/11/21.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. @protocol IMUserAble <NSObject>
  9. @required
  10. // 两个用户是否相同,可通过比较imUserId来判断
  11. // 用户IMSDK的identigier
  12. - (NSString *)imUserId;
  13. // 用户昵称
  14. - (NSString *)imUserName;
  15. // 用户头像地址
  16. - (NSString *)imUserIconUrl;
  17. @end
  18. #pragma mark --------------------------------------
  19. // 直播中用户的配置
  20. // 直播中要用到的
  21. // 简单的个人
  22. @protocol AVUserAble <IMUserAble>
  23. @required
  24. @property (nonatomic, assign) NSInteger avCtrlState;
  25. @end
  26. #pragma mark --------------------------------------
  27. @protocol AVMultiUserAble <AVUserAble>
  28. @required
  29. @property (nonatomic, assign) NSInteger avMultiUserState; //多人互动时IM配置
  30. // 互动时,用户画面显示的屏幕上的区域(opengl相关的位置)
  31. @property (nonatomic, assign) CGRect avInteractArea;
  32. // 互动时,因opengl放在最底层,之上是的自定义交互层,通常会完全盖住opengl
  33. // 用户要想与小画面进行交互的时候,必须在交互层上放一层透明的大小相同的控件,能过操作此控件来操作小窗口画面
  34. // 全屏交互的用户该值为空
  35. // 业务中若不存在交互逻辑,则不用填
  36. @property (nonatomic, weak) UIView *avInvisibleInteractView;
  37. @end
  38. #pragma mark --------------------------------------
  39. // 当前登录IMSDK的用户信息
  40. @protocol IMHostAble <AVMultiUserAble>
  41. @required
  42. // 当前App对应的AppID
  43. - (NSString *)imSDKAppId;
  44. // 当前App的AccountType
  45. - (NSString *)imSDKAccountType;
  46. @end
  47. #pragma mark --------------------------------------
  48. @protocol AVRoomAble <NSObject>
  49. @required
  50. // 聊天室Id
  51. @property (nonatomic, copy) NSString *liveIMChatRoomId;
  52. // 当前主播信息
  53. - (id<IMUserAble>)liveHost;
  54. // 直播房间Id
  55. - (int)liveAVRoomId;
  56. // 直播标题,可用于创建直播IM聊天室(具体还需要看使用哪种方式创建)
  57. // 另外推流以及录制时,使用默认配置时,是需要liveTitle参数
  58. - (NSString *)liveTitle;
  59. @end
  60. #pragma mark --------------------------------------
  61. // 直播中用到的IM消息类型
  62. // 直播过程中只能显示简单的文本消息
  63. // 关于消息的显示尽量做简单,以减少直播过程中IM消息量过大时直播视频不流畅
  64. @protocol AVIMMsgAble <NSObject>
  65. @required
  66. // 在渲染前,先计算渲染的内容(比如消息列表)
  67. - (void)prepareForRender;
  68. - (NSInteger)msgType;
  69. @end
  70. #pragma mark --------------------------------------
  71. @protocol FWShowLiveRoomAble <AVRoomAble>
  72. @required
  73. // 模糊遮盖图片的URL
  74. @property (nonatomic, copy) NSString *vagueImgUrl;
  75. // 视频类型,对应枚举FW_LIVE_TYPE
  76. @property (nonatomic, assign) NSInteger liveType;
  77. // SDK类型
  78. @property (nonatomic, assign) NSInteger sdkType;
  79. // 连麦类型
  80. @property (nonatomic, assign) NSInteger mickType;
  81. // 点赞数
  82. @property (nonatomic, assign) NSInteger livePraise;
  83. // 是否主播
  84. @property (nonatomic, assign) BOOL isHost;
  85. @property(nonatomic, assign) BOOL is_voice;
  86. @end
  87. #pragma mark --------------------------------------
  88. @protocol FWLiveControllerAble <NSObject>
  89. @required
  90. // 获取当前视频容器视图的父视图
  91. - (UIView *)getPlayViewBottomView;
  92. // 获取当前直播质量
  93. - (NSString *)getLiveQuality;
  94. // 设置静音 YES:设置为静音
  95. - (void)setSDKMute:(BOOL)bEnable;
  96. // 开始推流、拉流
  97. - (void)startLiveRtmp:(NSString *)playUrlStr;
  98. // 结束推流、拉流
  99. - (void)stopLiveRtmp;
  100. @end