Interface IRCCallPlusEventListener
-
- All Implemented Interfaces:
public interface IRCCallPlusEventListener
-
-
Method Summary
Modifier and Type Method Description abstract voidonReceivedCall(RCCallPlusSession callSession, String extra)本端用户通过该回调接收到通话呼叫。 该方法回调场景: - 本端用户没有正在进行中的音视频通话(getCurrentCallSession 获取的对象为空)时,远端用户通过 startCall 、invite 函数邀请本端用户进行通话。
- 本端用户正在进行音视频通话(getCurrentCallSession 获取的对象不为空)时,远端用户通过 startCall、invite 函数邀请本端用户进行通话。
public void onReceivedCall(RCCallPlusSession callSession) { RCCallPlusSession currentCallSession = RCCallPlusClient.getInstance().getCurrentCallSession(); if (currentCallSession != null && !TextUtils.equals(callSession.getCallId(), currentCallSession.getCallId())) { //在此处理有正在进行中的通话,又有第二通通话呼入的情况 //需要挂断 currentCallSession ,再接听新的通话 } }voidonCallConnected(RCCallPlusSession callSession)通话建立成功。 voidonRemoteUserInvited(String callId, ArrayList<String> inviteeUserList, String inviterUserId)远端用户被邀请回调。 voidonRemoteUserStateChanged(String callId, String userId, RCCallPlusUserSessionStatus status, RCCallPlusReason reason)远端用户状态改变监听。 voidonCallEnded(RCCallPlusSession session, RCCallPlusReason reason)己方参与过的通话结束时,收到该通话结束通知。如果本端正在进行中的通话结束后,getCurrentCallSession 会为空。 voidonReceivedCallRecord(RCCallPlusCallRecord record)己方参与过的通话结束时,收到该通话的通话记录。 voidonRemoteMicrophoneStateChanged(String callId, String userId, boolean disabled)远端用户麦克风状态改变监听。 voidonRemoteCameraStateChanged(String callId, String userId, boolean disabled)远端用户摄像头状态改变监听。 voidonReceivedChangeMediaTypeRequest(String transactionId, String userId, RCCallPlusMediaType mediaType)远端用户调用请求切换媒体 requestChangeMediaType 成功后收到 。 voidonReceivedChangeMediaTypeResult(String transactionId, String userId, RCCallPlusMediaType mediaType, RCCallPlusMediaTypeChangeResult result)通话媒体类型应答回调。 voidonCallTypeChanged(String callId, RCCallPlusType callType)单人通话时(PRIVATE),调用 invite 邀请其他人员成功,当前通话升级为群通话(MULTI) voidonFirstLocalVideoFrame(int width, int height)接收到本端摄像头流首帧回调。 voidonFirstRemoteAudioFrame(String userId)接收到远端音频流首帧回调。 voidonFirstRemoteVideoFrame(String userId, int width, int height)接收到远端视频流首帧回调。 voidonUserAudioLevelChanged(HashMap<String, Integer> hashMap)用户音量改变回调,每秒回调一次。 voidonCallStartTimeFromServer(long callStartTime)通话开始时间戳(当前时间到1970-1-1 00:00:00的总毫秒数)。 voidonCallFirstFrameTimeFromServer(long callFirstFrameTime)客户端收到首帧时间戳(当前时间到1970-1-1 00:00:00的总毫秒数)。 voidonReceivedCallPlusSummaryMessage(Message message)己方参与过的通话结束时,通话消息监听回调 目前,本回调仅在单人通话结束时(通话类型为PRIVATE)触发,并返回相应的信息。 在 IM Lib 登录成功后,将获取离线时产生的通话消息()。为了确保在登录成功后立即获取到这些消息,请在IM Lib初始化之前注册监听器:setCallPlusEventListener -
-
Method Detail
-
onReceivedCall
abstract void onReceivedCall(RCCallPlusSession callSession, String extra)
本端用户通过该回调接收到通话呼叫。
该方法回调场景:
- 本端用户没有正在进行中的音视频通话(getCurrentCallSession 获取的对象为空)时,远端用户通过 startCall 、invite 函数邀请本端用户进行通话。
- 本端用户正在进行音视频通话(getCurrentCallSession 获取的对象不为空)时,远端用户通过 startCall、invite 函数邀请本端用户进行通话。
如果本端用户需要接听该通话,需要先调用 hangup 方法挂断当前正在进行中的通话。再调用 accept 方法接听。
判断本端是否正在进行通话,又收到第二通呼叫方法:
public void onReceivedCall(RCCallPlusSession callSession) { RCCallPlusSession currentCallSession = RCCallPlusClient.getInstance().getCurrentCallSession(); if (currentCallSession != null && !TextUtils.equals(callSession.getCallId(), currentCallSession.getCallId())) { //在此处理有正在进行中的通话,又有第二通通话呼入的情况 //需要挂断 currentCallSession ,再接听新的通话 } }- Parameters:
callSession- 通话实体信息extra- 接收远端通过startCall 方法携带的扩展参数
-
onCallConnected
void onCallConnected(RCCallPlusSession callSession)
通话建立成功。
- Parameters:
callSession- 通话实体信息
-
onRemoteUserInvited
void onRemoteUserInvited(String callId, ArrayList<String> inviteeUserList, String inviterUserId)
远端用户被邀请回调。
- Parameters:
callId- 通话IdinviteeUserList- 被邀请用户列表inviterUserId- 邀请人用户Id
-
onRemoteUserStateChanged
void onRemoteUserStateChanged(String callId, String userId, RCCallPlusUserSessionStatus status, RCCallPlusReason reason)
远端用户状态改变监听。
- Parameters:
callId- 通话IduserId- 用户Idstatus- 该用户当前状态reason- 该用户当前状态原因
-
onCallEnded
void onCallEnded(RCCallPlusSession session, RCCallPlusReason reason)
己方参与过的通话结束时,收到该通话结束通知。如果本端正在进行中的通话结束后,getCurrentCallSession 会为空。
- Parameters:
session- 结束通话的实体对象reason- 通话结束原因
-
onReceivedCallRecord
void onReceivedCallRecord(RCCallPlusCallRecord record)
己方参与过的通话结束时,收到该通话的通话记录。
- Parameters:
record- 通话记录对象
-
onRemoteMicrophoneStateChanged
void onRemoteMicrophoneStateChanged(String callId, String userId, boolean disabled)
远端用户麦克风状态改变监听。
- Parameters:
callId- 通话IduserId- 用户Iddisabled- 麦克风是否可用,true:麦克风为关闭状态。false:麦克风为开启状态。
-
onRemoteCameraStateChanged
void onRemoteCameraStateChanged(String callId, String userId, boolean disabled)
远端用户摄像头状态改变监听。
- Parameters:
callId- 通话IduserId- 用户Iddisabled- 摄像头是否可用,true:摄像头为关闭状态。false:摄像头为开启状态。
-
onReceivedChangeMediaTypeRequest
void onReceivedChangeMediaTypeRequest(String transactionId, String userId, RCCallPlusMediaType mediaType)
远端用户调用请求切换媒体 requestChangeMediaType 成功后收到 。
- Parameters:
transactionId- 事务iduserId- 发起人idmediaType- 媒体类型
-
onReceivedChangeMediaTypeResult
void onReceivedChangeMediaTypeResult(String transactionId, String userId, RCCallPlusMediaType mediaType, RCCallPlusMediaTypeChangeResult result)
通话媒体类型应答回调。
- Parameters:
transactionId- 事务iduserId- 发起人idmediaType- 媒体类型result- 媒体类型切换结果
-
onCallTypeChanged
void onCallTypeChanged(String callId, RCCallPlusType callType)
单人通话时(PRIVATE),调用 invite 邀请其他人员成功,当前通话升级为群通话(MULTI)
-
onFirstLocalVideoFrame
void onFirstLocalVideoFrame(int width, int height)
接收到本端摄像头流首帧回调。
- Parameters:
width- 视频宽height- 视频高
-
onFirstRemoteAudioFrame
void onFirstRemoteAudioFrame(String userId)
接收到远端音频流首帧回调。
- Parameters:
userId- 用户Id
-
onFirstRemoteVideoFrame
void onFirstRemoteVideoFrame(String userId, int width, int height)
接收到远端视频流首帧回调。
- Parameters:
userId- 用户Idwidth- 视频宽height- 视频高
-
onUserAudioLevelChanged
void onUserAudioLevelChanged(HashMap<String, Integer> hashMap)
用户音量改变回调,每秒回调一次。
- Parameters:
hashMap- key:用户Id value:音量值大小(取值:0-9)
-
onCallStartTimeFromServer
void onCallStartTimeFromServer(long callStartTime)
通话开始时间戳(当前时间到1970-1-1 00:00:00的总毫秒数)。
- Parameters:
callStartTime- 已经做了时区校准,可以直接使用 (System.
-
onCallFirstFrameTimeFromServer
void onCallFirstFrameTimeFromServer(long callFirstFrameTime)
客户端收到首帧时间戳(当前时间到1970-1-1 00:00:00的总毫秒数)。
- Parameters:
callFirstFrameTime- 已经做了时区校准,可以直接使用 (System.
-
onReceivedCallPlusSummaryMessage
void onReceivedCallPlusSummaryMessage(Message message)
己方参与过的通话结束时,通话消息监听回调
目前,本回调仅在单人通话结束时(通话类型为PRIVATE)触发,并返回相应的信息。
在 IM Lib 登录成功后,将获取离线时产生的通话消息()。为了确保在登录成功后立即获取到这些消息,请在IM Lib初始化之前注册监听器:setCallPlusEventListener
- Parameters:
message- cn.rongcloud.callplus.api.
-
-
-