Skip to content

Commit

Permalink
fix: fix some event can not receive
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Mar 5, 2024
1 parent ff2c801 commit a044304
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 45 deletions.
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;

Check warning on line 305 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
switch (msg) {
case 'mute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);

Check warning on line 312 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO
);

Check warning on line 317 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,
null
);
break;

Check warning on line 318 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'mute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);

Check warning on line 324 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO
);

Check warning on line 329 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,
null
);
break;

Check warning on line 330 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'unmute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);

Check warning on line 336 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_AUDIO_STATE_REASON
.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,
null
);
break;

Check warning on line 337 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'unmute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);

Check warning on line 343 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1(
this._irisClient.connection,
remoteUid,
null,
NATIVE_RTC.REMOTE_VIDEO_STATE_REASON
.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,
null
);
break;

Check warning on line 344 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'enable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
true
);

Check warning on line 350 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
remoteUid,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO
);

Check warning on line 355 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 356 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'disable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
remoteUid,
_uid,
false
);

Check warning on line 362 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 363 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 364 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
if (uid === this.agoraRTCClient.uid) {
switch (msg) {
case 'mute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
_uid,
true
);

Check warning on line 372 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO
);

Check warning on line 377 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 378 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 378 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'mute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
_uid,
true
);

Check warning on line 384 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO
);

Check warning on line 389 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 390 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 390 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'unmute-audio':
this._engine.rtcEngineEventHandler.onUserMuteAudio_0aac2fe(
this._irisClient.connection,
_uid,
false
);

Check warning on line 396 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 397 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 397 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
case 'unmute-video':
this._engine.rtcEngineEventHandler.onUserMuteVideo_0aac2fe(
this._irisClient.connection,
_uid,
false
);

Check warning on line 403 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 404 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
case 'enable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
_uid,
true
);

Check warning on line 410 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
this._engine.rtcEngineEventHandler.onUserStateChanged_65f95a7(
this._irisClient.connection,
_uid,
NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO
);

Check warning on line 415 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 416 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
case 'disable-local-video':
this._engine.rtcEngineEventHandler.onUserEnableLocalVideo_0aac2fe(
this._irisClient.connection,
_uid,
false
);

Check warning on line 422 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 423 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 424 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} 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
);

Check warning on line 435 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 436 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
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
);

Check warning on line 445 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 446 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
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
);

Check warning on line 455 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 456 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
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
);

Check warning on line 465 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
break;

Check warning on line 466 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 467 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 468 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 468 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 468 in packages/rtc/src/event_handler/IrisClientEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

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
);

Check warning on line 148 in packages/rtc/src/event_handler/IrisTrackEventHandler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Expand Down

0 comments on commit a044304

Please sign in to comment.