diff --git a/packages/fake/rtc/package.json b/packages/fake/rtc/package.json index 38ae931..55d3889 100644 --- a/packages/fake/rtc/package.json +++ b/packages/fake/rtc/package.json @@ -1,6 +1,6 @@ { "name": "iris-web-rtc-fake", - "version": "0.8.3", + "version": "0.8.4", "description": "wait", "main": "./index.ts", "scripts": { diff --git a/packages/rtc/package.json b/packages/rtc/package.json index 7034a59..6304eb5 100644 --- a/packages/rtc/package.json +++ b/packages/rtc/package.json @@ -1,6 +1,6 @@ { "name": "iris-web-rtc", - "version": "0.8.3", + "version": "0.8.4", "description": "wait", "main": "./src/index.ts", "scripts": { diff --git a/packages/rtc/src/event_handler/IrisClientEventHandler.ts b/packages/rtc/src/event_handler/IrisClientEventHandler.ts index e744a46..ca10223 100644 --- a/packages/rtc/src/event_handler/IrisClientEventHandler.ts +++ b/packages/rtc/src/event_handler/IrisClientEventHandler.ts @@ -204,6 +204,31 @@ export class IrisClientEventHandler { } else { userPackage.uid = remoteUid; } + this._engine.rtcEngineEventHandler.onRemoteAudioStateChanged_056772e( + this._irisClient.connection, + remoteUid, + user.hasAudio + ? NATIVE_RTC.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STARTING + : NATIVE_RTC.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED, + user.hasAudio + ? NATIVE_RTC.REMOTE_AUDIO_STATE_REASON + .REMOTE_AUDIO_REASON_REMOTE_UNMUTED + : NATIVE_RTC.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED, + 0 + ); + this._engine.rtcEngineEventHandler.onRemoteVideoStateChanged_a14e9d1( + this._irisClient.connection, + remoteUid, + user.hasVideo + ? NATIVE_RTC.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STARTING + : NATIVE_RTC.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED, + user.hasVideo + ? NATIVE_RTC.REMOTE_VIDEO_STATE_REASON + .REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED + : NATIVE_RTC.REMOTE_VIDEO_STATE_REASON + .REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED, + 0 + ); } async onEventUserLeft( diff --git a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts index 60ce7ca..1b7ea7a 100644 --- a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts +++ b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts @@ -560,11 +560,6 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { } catch (e) { AgoraConsole.warn(`createAudioTrack error: ${e}`); } - } else { - await this._engine.irisClientManager.irisClientObserver.notifyLocal( - NotifyType.REMOVE_TRACK, - this._engine.irisClientManager.localAudioTrackPackages - ); } for (let trackPackage of this._engine.irisClientManager diff --git a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts index 5568051..af9504a 100644 --- a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts +++ b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts @@ -799,7 +799,7 @@ describe('IAgoraRtcEngineImpl', () => { irisRtcEngine.irisClientManager.getLocalAudioTrackPackageBySourceType( IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary ).length - ).toBe(0); + ).toBe(1); await joinChannel(apiEnginePtr, null); await callIris(apiEnginePtr, 'RtcEngine_enableAudio', null); expect( diff --git a/packages/rtc/test/impl/IAgoraRtcEngineImplEx.test.ts b/packages/rtc/test/impl/IAgoraRtcEngineImplEx.test.ts index 6c1bb11..3b3de92 100644 --- a/packages/rtc/test/impl/IAgoraRtcEngineImplEx.test.ts +++ b/packages/rtc/test/impl/IAgoraRtcEngineImplEx.test.ts @@ -177,6 +177,15 @@ describe('IAgoraRtcEngineImpl', () => { expect(agoraRTCClient?.setClientRole).toBeCalledTimes(1); }); test('setupRemoteVideoEx_522a409', async () => { + let connection = await joinChannelEx(apiEnginePtr); + let param2 = { + canvas: { + uid: TEST_REMOTE_UID, + view: 'test-view', + sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE, + }, + connection: connection, + }; await callIris( apiEnginePtr, 'RtcEngine_registerEventHandler_5fc0465', @@ -215,15 +224,6 @@ describe('IAgoraRtcEngineImpl', () => { }, ] ); - let connection = await joinChannelEx(apiEnginePtr); - let param2 = { - canvas: { - uid: TEST_REMOTE_UID, - view: 'test-view', - sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE, - }, - connection: connection, - }; }); test('muteLocalAudioStreamEx_3cf17a4', async () => { let connection = await joinChannelEx(apiEnginePtr);