EVENT

接入侧需要监听处理的事件列表,详细如下:

Members

(static) ERROR

sdk内部发生了错误

Example
let onError = function(error) {
  console.log(error)
};
trtcCalling.on(TRTCCalling.EVENT.ERROR, onError);

(static) SDK_READY

SDK 进入 ready 状态时收到该回调

  • v1.0.0 及其之后版本,新增此事件
Example
let onSDKReady = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.SDK_READY, onSDKReady);

(static) INVITED

被邀请进行通话

Example
let handleNewInvitationReceived = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.INVITED, handleNewInvitationReceived);

(static) USER_ACCEPT

如果有用户接听,那么会收到此回调

Example
let handleUserAccept = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_ACCEPT, handleUserAccept);

(static) USER_ENTER

如果有用户同意进入通话,那么会收到此回调

Example
let handleUserEnter = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_ENTER, handleUserEnter);

(static) USER_LEAVE

如果有用户同意离开通话,那么会收到此回调

Example
let handleUserLeave = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_LEAVE, handleUserLeave);

(static) REJECT

用户拒绝通话

  1. 在C2C通话中,只有发起方会收到拒绝回调 例如 A 邀请 B、C 进入通话,B拒绝,A可以收到该回调,但C不行
  2. 在IM群组通话中,所有被邀请人均能收到该回调 例如 A 邀请 B、C 进入通话,B拒绝,A、C均能收到该回调
Example
let handleInviteeReject = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.REJECT, handleInviteeReject);

(static) NO_RESP

邀请用户无应答

  1. 在C2C通话中,只有发起方会收到无人应答的回调 例如 A 邀请 B、C 进入通话,B不应答,A可以收到该回调,但C不行
  2. 在IM群组通话中,所有被邀请人均能收到该回调 例如 A 邀请 B、C 进入通话,B不应答,A、C均能收到该回调
Example
let handleNoResponse = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.NO_RESP, handleNoResponse);

(static) LINE_BUSY

邀请方忙线

Example
let handleLineBusy = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.LINE_BUSY, handleLineBusy);

(static) CALLING_CANCEL

作为被邀请方会收到,收到该回调说明本次通话被取消了

Example
let handleCallingCancel = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.CALLING_CANCEL, handleCallingCancel);

(static) KICKED_OUT

重复登陆,收到该回调说明被踢出房间

Example
let handleOnKickedOut = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.KICKED_OUT, handleOnKickedOut);

(static) CALLING_TIMEOUT

作为被邀请方会收到,收到该回调说明本次通话超时未应答

Example
let handleCallingTimeout = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.CALLING_TIMEOUT, handleCallingTimeout);

(static) CALLING_END

收到该回调说明本次通话结束了

Example
let handleCallingEnd = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.CALLING_END, handleCallingEnd);

(static) USER_VIDEO_AVAILABLE

远端用户开启/关闭了摄像头, 会收到该回调

Example
let handleUserVideoChange = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_VIDEO_AVAILABLE, handleUserVideoChange);

(static) USER_AUDIO_AVAILABLE

远端用户开启/关闭了麦克风, 会收到该回调

Example
let handleUserAudioChange = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_AUDIO_AVAILABLE, handleUserAudioChange);

(static) USER_VOICE_VOLUME

远端用户说话音量调整, 会收到该回调

Example
let handleUserVoiceVolumeChange = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.USER_VOICE_VOLUME, handleUserVoiceVolumeChange);

(static) GROUP_CALL_INVITEE_LIST_UPDATE

群聊更新邀请列表收到该回调

  • v1.0.0 及其之后版本,新增此事件
Example
let handleGroupInviteeListUpdate = function(event) {
  console.log(event)
};
trtcCalling.on(TRTCCalling.EVENT.GROUP_CALL_INVITEE_LIST_UPDATE, handleGroupInviteeListUpdate);