Skip to content

Commit

Permalink
fix(service-providers): fix device id after creating tracks (#1914)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored May 6, 2023
1 parent 02a4fa5 commit 50ddfeb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions service-providers/agora-rtc/agora-rtc-web/src/agora-rtc-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ export class AgoraRTCWeb extends IServiceVideoChat {
if (this._pJoiningRoom) {
await this._pJoiningRoom;
}

// If there is setCameraID() called during the promises above,
// the actually used camera ID may be different, so correct it here.
if (this._cameraID) {
this.localCameraTrack.setDevice(this._cameraID);
}
}
return this.localCameraTrack;
});
Expand All @@ -514,6 +520,12 @@ export class AgoraRTCWeb extends IServiceVideoChat {
if (this._pJoiningRoom) {
await this._pJoiningRoom;
}

// If there is setMicID() called during the promises above,
// the actually used microphone ID may be different, so correct it here.
if (this._micID) {
this.localMicTrack.setDevice(this._micID);
}
}
return this.localMicTrack;
});
Expand Down

0 comments on commit 50ddfeb

Please sign in to comment.