public class JMRtcListener
extends java.lang.Object
Constructor and Description |
---|
JMRtcListener() |
Modifier and Type | Method and Description |
---|---|
void |
onCallConnected(JMRtcSession callSession,
android.view.SurfaceView localSurfaceView)
音视频通信连接已建立。
当被邀请方有任意一方成功调用
JMRtcClient.accept(BasicCallback) 接受邀请后,邀请方和接受方都会触发此回调通知上层通信连接已建立。 |
void |
onCallDisconnected(JMRtcClient.DisconnectReason reason)
通话连接断开。
|
void |
onCallError(int errorCode,
java.lang.String desc)
通话过程中发生错误
|
void |
onCallInviteReceived(JMRtcSession callSession)
被邀请方收到邀请时,会触发此回调通知上层收到通话邀请。
|
void |
onCallMemberJoin(UserInfo joinedUserInfo,
android.view.SurfaceView remoteSurfaceView)
对于刚加入通信的用户,此接口会上报当前所有已在通信中的用户的信息。
对于已加入通信的用户,此接口上报通信过程中加入的用户的信息。
|
void |
onCallMemberOffline(UserInfo leavedUserInfo,
JMRtcClient.DisconnectReason reason)
通话过程中,有用户退出通话。
|
void |
onCallOtherUserInvited(UserInfo fromUserInfo,
java.util.List<UserInfo> invitedUserInfos,
JMRtcSession callSession)
通话过程中,有其他用户被邀请。
|
void |
onCallOutgoing(JMRtcSession callSession)
邀请方成功调用
JMRtcClient.call(List, JMSignalingMessage.MediaType, BasicCallback) 后,会触发此回调通知上层通话已播出。 |
void |
onEngineInitComplete(int errCode,
java.lang.String errDesc)
jmrtc引擎初始化结果回调。
|
void |
onPermissionNotGranted(java.lang.String[] requiredPermissions)
音视频引擎初始化过程中,有些必要的权限没有获取到导致初始化失败时回调。
|
void |
onRemoteVideoMuted(UserInfo remoteUser,
boolean isMuted)
对方用户禁用/启用视频流时的回调。
|
public void onEngineInitComplete(int errCode, java.lang.String errDesc)
errCode
- 错误码。 0 - 成功,其他错误码参见错误码定义表errDesc
- 错误描述。public void onCallOutgoing(JMRtcSession callSession)
JMRtcClient.call(List, JMSignalingMessage.MediaType, BasicCallback)
后,会触发此回调通知上层通话已播出。callSession
- 保存通信元信息的实体对象public void onCallInviteReceived(JMRtcSession callSession)
callSession
- 保存通信元信息的实体对象public void onCallOtherUserInvited(UserInfo fromUserInfo, java.util.List<UserInfo> invitedUserInfos, JMRtcSession callSession)
fromUserInfo
- 邀请发起方用户信息invitedUserInfos
- 被邀请方用户信息集合callSession
- 保存通信元信息的实体对象public void onCallConnected(JMRtcSession callSession, android.view.SurfaceView localSurfaceView)
JMRtcClient.accept(BasicCallback)
接受邀请后,邀请方和接受方都会触发此回调通知上层通信连接已建立。callSession
- 保存通信元信息的实体对象localSurfaceView
- 本地视频预览SurfaceView对象,对于视频聊天,上层可以直接用此对象在界面上进行渲染展示。public void onCallMemberJoin(UserInfo joinedUserInfo, android.view.SurfaceView remoteSurfaceView)
joinedUserInfo
- 加入的用户的用户信息remoteSurfaceView
- 加入用户的视频预览SurfaceView对象。对于视频聊天,上层可以直接用此对象在界面上进行渲染展示。public void onCallMemberOffline(UserInfo leavedUserInfo, JMRtcClient.DisconnectReason reason)
leavedUserInfo
- 退出通话的用户的用户信息reason
- 退出原因public void onCallDisconnected(JMRtcClient.DisconnectReason reason)
reason
- 断开原因public void onCallError(int errorCode, java.lang.String desc)
errorCode
- 错误码desc
- 错误描述public void onPermissionNotGranted(java.lang.String[] requiredPermissions)
上层收到此回调后,建议根据系统具体版本决定是否需要向用户动态申请权限(android 6.0之后)。
权限申请成功之后,需要调用JMRtcClient.reinitEngine()
重新初始化引擎。
requiredPermissions
- 缺少的权限public void onRemoteVideoMuted(UserInfo remoteUser, boolean isMuted)
remoteUser
- 用户信息isMuted
- 是否禁用。 true - 禁用,false - 启用