Skip to content

Commit

Permalink
fix: fix some event can not receive (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe authored Mar 19, 2024
1 parent ff2c801 commit dc46c16
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 939 deletions.
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.1.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

156 changes: 114 additions & 42 deletions packages/rtc/src/event_handler/IrisClientEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,98 +302,170 @@ export class IrisClientEventHandler {
| 'unmute-video'
| 'disable-local-video'
): void {
let remoteUid = uid as number;

let _uid = uid as number;
switch (msg) {
case 'mute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO
);
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,
null
);
break;
case 'mute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO
);
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,
null
);
break;
case 'unmute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON
.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,
null
);
break;
case 'unmute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,
null
);
break;
case 'enable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO
);
break;
case 'disable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);
break;
}
if (uid === this.agoraRTCClient.uid) {
switch (msg) {
case 'mute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO
);
break;
case 'mute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO
);
break;
case 'unmute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
_uid,
false
);
break;
case 'unmute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
_uid,
false
);
break;
case 'enable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
_uid,
true
);
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO
);
break;
case 'disable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
_uid,
false
);
break;
}
} else {
switch (msg) {
case 'mute-audio':
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON
.REMOTE_AUDIO_REASON_REMOTE_MUTED,
0
);
break;
case 'mute-video':
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,
0
);
break;
case 'unmute-audio':
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STARTING,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON
.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,
0
);
break;
case 'unmute-video':
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STARTING,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,
0
);
break;
}
}
}

onStreamMessage(uid: UID, payload: Uint8Array): void {
Expand Down
6 changes: 3 additions & 3 deletions packages/rtc/src/event_handler/IrisTrackEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export class IrisTrackEventHandler {
onEventVideoElementVisibleStatus(data?: CheckVideoVisibleResult): void {
this._engine.rtcEngineEventHandler.onFirstLocalVideoFrame_ebdfd19(
this._videoSourceType as NATIVE_RTC.VIDEO_SOURCE_TYPE,
null,
null,
null
0,
0,
0
);
}

Expand Down

0 comments on commit dc46c16

Please sign in to comment.