LiveRoomContract.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package com.cooleshow.teacher.contract;
  2. import android.view.View;
  3. import com.cooleshow.base.presenter.view.BaseView;
  4. import com.cooleshow.chatmodule.bean.ContactListBean;
  5. import com.cooleshow.teacher.bean.LiveRoomInfoBean;
  6. import com.daya.tclive.bean.FriendInfoBean;
  7. import com.rong.io.live.message.RCChatJoinRoomMessage;
  8. import com.rong.io.live.message.RCOnSnappingUpMessage;
  9. import com.rong.io.live.message.RCUserAddLikeMessage;
  10. import com.rong.io.live.message.RCUserSeatApplyMessage;
  11. import java.util.List;
  12. import cn.rongcloud.rtc.api.RCRTCRemoteUser;
  13. import cn.rongcloud.rtc.api.stream.RCRTCVideoView;
  14. import cn.rongcloud.rtc.base.RCRTCLiveRole;
  15. import io.rong.imlib.model.Message;
  16. import io.rong.imlib.model.MessageContent;
  17. /**
  18. * 创建日期:2022/5/20 15:02
  19. *
  20. * @author Ryan
  21. * 类说明:
  22. */
  23. public interface LiveRoomContract {
  24. interface LiveRoomView extends BaseView {
  25. /**
  26. * 获取房间信息成功
  27. *
  28. * @param roomInfoBean
  29. */
  30. void getRoomInfoSuccess(LiveRoomInfoBean roomInfoBean);
  31. /**
  32. * 获取房间信息失败
  33. *
  34. * @param throwable
  35. */
  36. void getRoomInfoError(Throwable throwable);
  37. /**
  38. * 显示finishview
  39. */
  40. void showFinishView();
  41. /**
  42. * 添加多条公屏消息
  43. */
  44. void addMessageList(List<MessageContent> messageContents, boolean isReset);
  45. /**
  46. * 添加单条公屏消息
  47. */
  48. void addMessageContent(Message message, boolean isReset);
  49. /**
  50. * 设置房间数据
  51. */
  52. void setRoomData(LiveRoomInfoBean roomInfoBean);
  53. /**
  54. * 推流成功
  55. */
  56. void onPublishSuccess();
  57. View getContentView();
  58. void addVideoPreview(RCRTCVideoView videoView);
  59. void openCameraSuccess(Boolean data);
  60. void openCameraError(String errorMsg);
  61. /**
  62. * 成员同步
  63. *
  64. * @param count
  65. */
  66. void syncMemberCount(String count);
  67. /**
  68. * 加入房间消息
  69. *
  70. * @param joinRoomMessage
  71. */
  72. void receiveJoinMessage(RCChatJoinRoomMessage joinRoomMessage);
  73. /**
  74. * 抢购消息
  75. *
  76. * @param
  77. */
  78. void receiveSnapUpMessage(RCOnSnappingUpMessage snappingUpMessage);
  79. void liveRoomOffline();
  80. void onAddLikeMessage(RCUserAddLikeMessage addLikeMessage);
  81. void onUserJoinRoom(RCRTCRemoteUser rcrtcRemoteUser);
  82. void onUserLeftRoomMic(RCRTCRemoteUser rcrtcRemoteUser);
  83. void onUserOfflineRoomMic(RCRTCRemoteUser rcrtcRemoteUser);
  84. void onSwitchRole(String userId, RCRTCLiveRole role);
  85. /**
  86. * 连麦申请
  87. */
  88. void onSeatApplyMessage(RCUserSeatApplyMessage seatApplyMessage);
  89. /**
  90. * 远端有用户推流
  91. * @param remoteUserId
  92. */
  93. void onRemoteUserPublishResource(String remoteUserId);
  94. /**
  95. * 获取用户信息成功
  96. * @param data
  97. */
  98. void getFriendInfoSuccess(FriendInfoBean data);
  99. /**
  100. * 用户离开房间消息
  101. * @param targetUserId
  102. */
  103. void onUserLeaveRoom(String targetUserId);
  104. }
  105. interface Presenter {
  106. void handleAction(int action, Object... params);
  107. void notifyJoinRoomAction(String roomId, String userId);
  108. void notifyLeaveRoomAction();
  109. }
  110. }