Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Aug 26, 2024
1 parent d001e25 commit 37a811e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/rtc/src/helper/ImplHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ export class ImplHelper {
irisClient.connection = con;
this._engine.rtcEngineEventHandler.onJoinChannelSuccess_263e4cd(con, 0);

if (this._engine.globalState.enabledAudio) {
if (
irisClient.irisClientState.clientRoleType ===
NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER &&
this._engine.globalState.enabledAudio
) {
if (
!this._engine.irisClientManager.getLocalAudioTrackPackageBySourceType(
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary
Expand Down
6 changes: 5 additions & 1 deletion packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx {
0
);

if (this._engine.globalState.enabledAudio) {
if (
irisClient.irisClientState.clientRoleType ===
NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER &&
this._engine.globalState.enabledAudio
) {
if (
!this._engine.irisClientManager.getLocalAudioTrackPackageBySourceType(
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary
Expand Down

0 comments on commit 37a811e

Please sign in to comment.