diff --git a/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts b/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts index 83817df6..b6b4d5cc 100644 --- a/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts +++ b/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts @@ -2532,18 +2532,20 @@ export class IRtcEngineDispatch implements IRtcEngine { // @ts-ignore enableLocalVideo_5039d15(apiParam: ApiParam): CallApiReturnType { - AgoraConsole.warn( - 'enableLocalVideo_5039d15 not supported in this platform!' - ); - return this._engine.returnResult(false, -ERROR_CODE_TYPE.ERR_NOT_SUPPORTED); + let obj = JSON.parse(apiParam.data) as any; + let enabled = obj.enabled; + if (enabled === undefined) throw 'enabled is undefined'; + + return this._impl.enableLocalVideo_5039d15(enabled); } // @ts-ignore muteAllRemoteVideoStreams_5039d15(apiParam: ApiParam): CallApiReturnType { - AgoraConsole.warn( - 'muteAllRemoteVideoStreams_5039d15 not supported in this platform!' - ); - return this._engine.returnResult(false, -ERROR_CODE_TYPE.ERR_NOT_SUPPORTED); + let obj = JSON.parse(apiParam.data) as any; + let mute = obj.mute; + if (mute === undefined) throw 'mute is undefined'; + + return this._impl.muteAllRemoteVideoStreams_5039d15(mute); } // @ts-ignore @@ -2568,10 +2570,13 @@ export class IRtcEngineDispatch implements IRtcEngine { // @ts-ignore muteRemoteVideoStream_dbdc15a(apiParam: ApiParam): CallApiReturnType { - AgoraConsole.warn( - 'muteRemoteVideoStream_dbdc15a not supported in this platform!' - ); - return this._engine.returnResult(false, -ERROR_CODE_TYPE.ERR_NOT_SUPPORTED); + let obj = JSON.parse(apiParam.data) as any; + let uid = obj.uid; + if (uid === undefined) throw 'uid is undefined'; + let mute = obj.mute; + if (mute === undefined) throw 'mute is undefined'; + + return this._impl.muteRemoteVideoStream_dbdc15a(uid, mute); } // @ts-ignore diff --git a/packages/rtc/src/binding/IAgoraRtcEngineExDispatch.ts b/packages/rtc/src/binding/IAgoraRtcEngineExDispatch.ts index ffb80649..4cfbd9ef 100644 --- a/packages/rtc/src/binding/IAgoraRtcEngineExDispatch.ts +++ b/packages/rtc/src/binding/IAgoraRtcEngineExDispatch.ts @@ -95,10 +95,15 @@ export class IRtcEngineExDispatch extends IRtcEngineDispatch // @ts-ignore muteRemoteVideoStreamEx_6d93082(apiParam: ApiParam): CallApiReturnType { - AgoraConsole.warn( - 'muteRemoteVideoStreamEx_6d93082 not supported in this platform!' - ); - return this._engine.returnResult(false, -ERROR_CODE_TYPE.ERR_NOT_SUPPORTED); + let obj = JSON.parse(apiParam.data) as any; + let uid = obj.uid; + if (uid === undefined) throw 'uid is undefined'; + let mute = obj.mute; + if (mute === undefined) throw 'mute is undefined'; + let connection = obj.connection; + if (connection === undefined) throw 'connection is undefined'; + + return this._impl.muteRemoteVideoStreamEx_6d93082(uid, mute, connection); } // @ts-ignore @@ -144,10 +149,13 @@ export class IRtcEngineExDispatch extends IRtcEngineDispatch // @ts-ignore muteAllRemoteVideoStreamsEx_3cf17a4(apiParam: ApiParam): CallApiReturnType { - AgoraConsole.warn( - 'muteAllRemoteVideoStreamsEx_3cf17a4 not supported in this platform!' - ); - return this._engine.returnResult(false, -ERROR_CODE_TYPE.ERR_NOT_SUPPORTED); + let obj = JSON.parse(apiParam.data) as any; + let mute = obj.mute; + if (mute === undefined) throw 'mute is undefined'; + let connection = obj.connection; + if (connection === undefined) throw 'connection is undefined'; + + return this._impl.muteAllRemoteVideoStreamsEx_3cf17a4(mute, connection); } // @ts-ignore diff --git a/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts b/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts index 750cd84b..7714f27b 100644 --- a/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts +++ b/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts @@ -220,4 +220,90 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { return this._engine.execute(processFunc); } + + muteRemoteVideoStreamEx_6d93082( + uid: number, + mute: boolean, + connection: NATIVE_RTC.RtcConnection + ): CallApiReturnType { + let processFunc = async (): Promise => { + let remoteUserPackages = this._engine.irisClientManager.getRemoteUserPackagesByConnection( + connection + ); + let remoteUsers = remoteUserPackages.filter((userPackage) => { + return userPackage.uid == uid; + }); + this._engine.irisClientManager.irisClientObserver.notifyRemote( + mute + ? NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK + : NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + remoteUsers + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + muteLocalVideoStreamEx_3cf17a4( + mute: boolean, + connection: NATIVE_RTC.RtcConnection + ): CallApiReturnType { + let processFunc = async (): Promise => { + let localVideoTrackPackages = this._engine.irisClientManager.getLocalVideoTrackPackageByConnection( + connection + ); + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + mute ? NotifyType.MUTE_TRACK : NotifyType.UNMUTE_TRACK, + localVideoTrackPackages + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + muteAllRemoteVideoStreamsEx_3cf17a4( + mute: boolean, + connection: NATIVE_RTC.RtcConnection + ): CallApiReturnType { + let processFunc = async (): Promise => { + let remoteUserPackages = this._engine.irisClientManager.getRemoteUserPackagesByConnection( + connection + ); + this._engine.irisClientManager.irisClientObserver.notifyRemote( + mute + ? NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK + : NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + remoteUserPackages + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + createDataStreamEx_9f641b6( + streamId: number, + config: NATIVE_RTC.DataStreamConfig, + connection: NATIVE_RTC.RtcConnection + ): CallApiReturnType { + let processFunc = async (): Promise => { + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + sendStreamMessageEx_0c34857( + streamId: number, + data: Uint8Array, + length: number, + connection: NATIVE_RTC.RtcConnection + ): CallApiReturnType { + let processFunc = async (): Promise => { + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } } diff --git a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts index 17f75c4f..c6badfdc 100644 --- a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts +++ b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts @@ -299,10 +299,9 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { )); //todo1 需要确认这个api是不是会改变所有connection的role,目前只改变了irisClientList[0]的 - //todo2 需要追加调用 muteLocalVideoStream 修改发布状态。 这个api都还没做 if (role === NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE) { this.muteLocalAudioStream_5039d15(true); - // this.muteLocalVideoStream(true); + this.muteLocalVideoStream_5039d15(true); } //如果已经加入频道 if (client?.channelName) { @@ -340,10 +339,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { } //remote - this._engine.irisClientManager.irisClientObserver.notifyRemote( - NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, - this._engine.irisClientManager.remoteUserPackages - ); + this.muteAllRemoteVideoStreams_5039d15(false); return this._engine.returnResult(); }; @@ -370,10 +366,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { } //remote - this._engine.irisClientManager.irisClientObserver.notifyRemote( - NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK, - this._engine.irisClientManager.remoteUserPackages - ); + this.muteAllRemoteVideoStreams_5039d15(true); return this._engine.returnResult(); }; @@ -648,6 +641,23 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { return this._engine.execute(processFunc); } + + enableLocalVideo_5039d15(enabled: boolean): CallApiReturnType { + let processFunc = async (): Promise => { + this._engine.globalState.enabledLocalAudio = enabled; + + //找到本地video + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + enabled ? NotifyType.ENABLE_TRACK : NotifyType.UNABLE_TRACK, + this._engine.irisClientManager.localVideoTrackPackages + ); + + this.muteLocalVideoStream_5039d15(!enabled); + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } muteLocalAudioStream_5039d15(mute: boolean): CallApiReturnType { let processFunc = async (): Promise => { await this._engine.irisClientManager.irisClientObserver.notifyLocal( @@ -660,6 +670,72 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { return this._engine.execute(processFunc); } + + muteLocalVideoStream_5039d15(mute: boolean): CallApiReturnType { + let process = async () => { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + mute ? NotifyType.MUTE_TRACK : NotifyType.UNMUTE_TRACK, + this._engine.irisClientManager.localVideoTrackPackages + ); + + return this._engine.returnResult(); + }; + return this._engine.execute(process); + } + + createDataStream_5862815( + streamId: number, + config: NATIVE_RTC.DataStreamConfig + ): CallApiReturnType { + let process = async () => { + return this._engine.returnResult(); + }; + return this._engine.execute(process); + } + + sendStreamMessage_8715a45( + streamId: number, + data: Uint8Array, + length: number + ): CallApiReturnType { + let process = async () => { + return this._engine.returnResult(); + }; + return this._engine.execute(process); + } + + muteAllRemoteVideoStreams_5039d15(mute: boolean): CallApiReturnType { + let processFunc = async (): Promise => { + this._engine.irisClientManager.irisClientObserver.notifyRemote( + mute + ? NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK + : NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + this._engine.irisClientManager.remoteUserPackages + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + muteRemoteVideoStream_dbdc15a(uid: number, mute: boolean): CallApiReturnType { + let processFunc = async (): Promise => { + let remoteUserPackage = this._engine.irisClientManager.getRemoteUserPackageByUid( + uid + ); + this._engine.irisClientManager.irisClientObserver.notifyRemote( + mute + ? NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK + : NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + [remoteUserPackage] + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); + } + muteAllRemoteAudioStreams_5039d15(mute: boolean): CallApiReturnType { let processFunc = async (): Promise => { this._engine.irisClientManager.irisClientObserver.notifyRemote( diff --git a/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts b/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts index c7aececb..41569c9a 100644 --- a/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts +++ b/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts @@ -4629,9 +4629,37 @@ describe('IRtcEngine', () => { ).toBeCalledWith('test'); }); + test('RtcEngine_enableLocalVideo_5039d15 parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new IrisCore.EventParam( + 'RtcEngine_enableLocalVideo_5039d15', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + test('RtcEngine_enableLocalVideo_5039d15 impl call', async () => { jest - .spyOn(irisRtcEngine, 'returnResult') + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableLocalVideo_5039d15' + ) .mockResolvedValue(new CallIrisApiResult(0, '')); let nParam = { enabled: 'test', @@ -4648,18 +4676,45 @@ describe('IRtcEngine', () => { await IrisCore.callIrisApi(apiEnginePtr, apiParam); expect( irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl - ?.enableLocalVideo_5039d15 - ).toBeUndefined(); - expect(irisRtcEngine.returnResult).toBeCalledTimes(1); - expect(irisRtcEngine.returnResult).toBeCalledWith( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + .enableLocalVideo_5039d15 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableLocalVideo_5039d15 + ).toBeCalledWith('test'); + }); + + test('RtcEngine_muteAllRemoteVideoStreams_5039d15 parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new IrisCore.EventParam( + 'RtcEngine_muteAllRemoteVideoStreams_5039d15', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } }); test('RtcEngine_muteAllRemoteVideoStreams_5039d15 impl call', async () => { jest - .spyOn(irisRtcEngine, 'returnResult') + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteAllRemoteVideoStreams_5039d15' + ) .mockResolvedValue(new CallIrisApiResult(0, '')); let nParam = { mute: 'test', @@ -4676,13 +4731,12 @@ describe('IRtcEngine', () => { await IrisCore.callIrisApi(apiEnginePtr, apiParam); expect( irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl - ?.muteAllRemoteVideoStreams_5039d15 - ).toBeUndefined(); - expect(irisRtcEngine.returnResult).toBeCalledTimes(1); - expect(irisRtcEngine.returnResult).toBeCalledWith( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + .muteAllRemoteVideoStreams_5039d15 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteAllRemoteVideoStreams_5039d15 + ).toBeCalledWith('test'); }); test('RtcEngine_setDefaultMuteAllRemoteVideoStreams_5039d15 impl call', async () => { @@ -4741,9 +4795,38 @@ describe('IRtcEngine', () => { ); }); + test('RtcEngine_muteRemoteVideoStream_dbdc15a parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new IrisCore.EventParam( + 'RtcEngine_muteRemoteVideoStream_dbdc15a', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + test('RtcEngine_muteRemoteVideoStream_dbdc15a impl call', async () => { jest - .spyOn(irisRtcEngine, 'returnResult') + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteRemoteVideoStream_dbdc15a' + ) .mockResolvedValue(new CallIrisApiResult(0, '')); let nParam = { uid: 'test', @@ -4761,13 +4844,12 @@ describe('IRtcEngine', () => { await IrisCore.callIrisApi(apiEnginePtr, apiParam); expect( irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl - ?.muteRemoteVideoStream_dbdc15a - ).toBeUndefined(); - expect(irisRtcEngine.returnResult).toBeCalledTimes(1); - expect(irisRtcEngine.returnResult).toBeCalledWith( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + .muteRemoteVideoStream_dbdc15a + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteRemoteVideoStream_dbdc15a + ).toBeCalledWith('test', 'test'); }); test('RtcEngine_setRemoteVideoStreamType_9e6406e impl call', async () => { diff --git a/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts b/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts index 1e110d17..a69421aa 100644 --- a/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts +++ b/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts @@ -384,9 +384,39 @@ describe('IRtcEngineEx', () => { ).toBeCalledWith('test', 'test', 'test'); }); + test('RtcEngineEx_muteRemoteVideoStreamEx_6d93082 parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new IrisCore.EventParam( + 'RtcEngineEx_muteRemoteVideoStreamEx_6d93082', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + test('RtcEngineEx_muteRemoteVideoStreamEx_6d93082 impl call', async () => { jest - .spyOn(irisRtcEngine, 'returnResult') + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteRemoteVideoStreamEx_6d93082' + ) .mockResolvedValue(new CallIrisApiResult(0, '')); let nParam = { uid: 'test', @@ -405,13 +435,12 @@ describe('IRtcEngineEx', () => { await IrisCore.callIrisApi(apiEnginePtr, apiParam); expect( irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl - ?.muteRemoteVideoStreamEx_6d93082 - ).toBeUndefined(); - expect(irisRtcEngine.returnResult).toBeCalledTimes(1); - expect(irisRtcEngine.returnResult).toBeCalledWith( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + .muteRemoteVideoStreamEx_6d93082 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRemoteVideoStreamEx_6d93082 + ).toBeCalledWith('test', 'test', 'test'); }); test('RtcEngineEx_setRemoteVideoStreamTypeEx_01dc428 impl call', async () => { @@ -615,9 +644,38 @@ describe('IRtcEngineEx', () => { ).toBeCalledWith('test', 'test'); }); + test('RtcEngineEx_muteAllRemoteVideoStreamsEx_3cf17a4 parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new IrisCore.EventParam( + 'RtcEngineEx_muteAllRemoteVideoStreamsEx_3cf17a4', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + test('RtcEngineEx_muteAllRemoteVideoStreamsEx_3cf17a4 impl call', async () => { jest - .spyOn(irisRtcEngine, 'returnResult') + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteAllRemoteVideoStreamsEx_3cf17a4' + ) .mockResolvedValue(new CallIrisApiResult(0, '')); let nParam = { mute: 'test', @@ -635,13 +693,12 @@ describe('IRtcEngineEx', () => { await IrisCore.callIrisApi(apiEnginePtr, apiParam); expect( irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl - ?.muteAllRemoteVideoStreamsEx_3cf17a4 - ).toBeUndefined(); - expect(irisRtcEngine.returnResult).toBeCalledTimes(1); - expect(irisRtcEngine.returnResult).toBeCalledWith( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + .muteAllRemoteVideoStreamsEx_3cf17a4 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteAllRemoteVideoStreamsEx_3cf17a4 + ).toBeCalledWith('test', 'test'); }); test('RtcEngineEx_setSubscribeAudioBlocklistEx_9f1e85c impl call', async () => { diff --git a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts index 3de20d92..3099d0f3 100644 --- a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts +++ b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts @@ -871,6 +871,82 @@ describe('IAgoraRtcEngineImpl', () => { }); expect(remoteUsers[0].audioTrack).not.toBeUndefined(); }); + + test('muteLocalVideoStream_5039d15', async () => { + jest.spyOn(rtcEngineImpl, 'muteLocalVideoStream_5039d15'); + await joinChannel(apiEnginePtr, null); + await callIris(apiEnginePtr, 'RtcEngine_enableVideo', null); + await callIris(apiEnginePtr, 'RtcEngine_startPreview', null); + let localVideoTrackPackage = irisRtcEngine.irisClientManager.getLocalVideoTrackPackageBySourceType( + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY + ); + expect(localVideoTrackPackage.length).toBe(1); + expect(localVideoTrackPackage[0].track.isPlaying).toBe(true); + expect((localVideoTrackPackage[0].track as ILocalTrack).muted).toBe(false); + + await callIris(apiEnginePtr, 'RtcEngine_muteLocalVideoStream_5039d15', { + mute: true, + }); + expect((localVideoTrackPackage[0].track as ILocalTrack).muted).toBe(true); + + await callIris(apiEnginePtr, 'RtcEngine_muteLocalVideoStream_5039d15', { + mute: false, + }); + expect((localVideoTrackPackage[0].track as ILocalTrack).muted).toBe(false); + }); + test('muteAllRemoteVideoStreams_5039d15', async () => { + jest.spyOn(rtcEngineImpl, 'muteAllRemoteVideoStreams_5039d15'); + await joinChannel(apiEnginePtr, null); + await setupLocalVideo(apiEnginePtr, null); + await setupRemoteVideo(apiEnginePtr, null); + await callIris(apiEnginePtr, 'RtcEngine_enableVideo', null); + await callIris(apiEnginePtr, 'RtcEngine_startPreview', null); + let remoteUsers = + irisRtcEngine.irisClientManager.irisClientList[0]?.agoraRTCClient + .remoteUsers; + expect(remoteUsers[0].videoTrack.isPlaying).toBe(true); + + await callIris( + apiEnginePtr, + 'RtcEngine_muteAllRemoteVideoStreams_5039d15', + { + mute: true, + } + ); + expect(remoteUsers[0].videoTrack).toBeUndefined(); + await callIris( + apiEnginePtr, + 'RtcEngine_muteAllRemoteVideoStreams_5039d15', + { + mute: false, + } + ); + expect(remoteUsers[0].videoTrack).not.toBeUndefined(); + }); + test('muteRemoteVideoStream_dbdc15a', async () => { + jest.spyOn(rtcEngineImpl, 'muteRemoteVideoStream_dbdc15a'); + await joinChannel(apiEnginePtr, null); + await setupLocalVideo(apiEnginePtr, null); + await setupRemoteVideo(apiEnginePtr, null); + await callIris(apiEnginePtr, 'RtcEngine_enableVideo', null); + await callIris(apiEnginePtr, 'RtcEngine_startPreview', null); + let remoteUsers = + irisRtcEngine.irisClientManager.irisClientList[0]?.agoraRTCClient + .remoteUsers; + expect(remoteUsers[0].videoTrack.isPlaying).toBe(true); + + await callIris(apiEnginePtr, 'RtcEngine_muteRemoteVideoStream_dbdc15a', { + mute: true, + uid: TEST_REMOTE_UID, + }); + expect(remoteUsers[0].videoTrack).toBeUndefined(); + await callIris(apiEnginePtr, 'RtcEngine_muteRemoteVideoStream_dbdc15a', { + mute: false, + uid: TEST_REMOTE_UID, + }); + expect(remoteUsers[0].videoTrack).not.toBeUndefined(); + }); + test('setParameters_3a2037f', async () => { let params = JSON.stringify({ 'rtc.audio.force_bluetooth_a2dp': true, diff --git a/scripts/terra/config/support_list.json b/scripts/terra/config/support_list.json index 11c7a54b..69f3b457 100644 --- a/scripts/terra/config/support_list.json +++ b/scripts/terra/config/support_list.json @@ -17,14 +17,17 @@ "RtcEngine_leaveChannel", "RtcEngine_leaveChannel_2c0e3aa", "RtcEngine_enableLocalAudio_5039d15", + "RtcEngine_enableLocalVideo_5039d15", "RtcEngine_enableVideo", "RtcEngine_disableVideo", "RtcEngine_setChannelProfile_a78fa4f", "RtcEngine_muteAllRemoteAudioStreams_5039d15", + "RtcEngine_muteAllRemoteVideoStreams_5039d15", "RtcEngine_createDataStream_5862815", "RtcEngine_sendStreamMessage_8715a45", "RtcEngine_muteLocalVideoStream_5039d15", "RtcEngine_muteLocalAudioStream_5039d15", + "RtcEngine_muteRemoteVideoStream_dbdc15a", "RtcEngine_muteRemoteAudioStream_dbdc15a", "RtcEngine_startPreview", "RtcEngine_startPreview_4fd718e", @@ -40,11 +43,13 @@ "RtcEngine_playEffect_531a783", "RtcEngine_stopAllEffects", "RtcEngineEx_joinChannelEx_a3cd08c", + "RtcEngineEx_muteAllRemoteVideoStreamsEx_3cf17a4", "RtcEngineEx_muteAllRemoteAudioStreamsEx_3cf17a4", "RtcEngineEx_sendStreamMessageEx_0c34857", "RtcEngineEx_createDataStreamEx_9f641b6", "RtcEngineEx_muteLocalVideoStreamEx_3cf17a4", "RtcEngineEx_muteLocalAudioStreamEx_3cf17a4", + "RtcEngineEx_muteRemoteVideoStreamEx_6d93082", "RtcEngineEx_muteRemoteAudioStreamEx_6d93082", "RtcEngineEx_leaveChannelEx_c81e1a4", "RtcEngineEx_updateChannelMediaOptionsEx_457bb35",