Whenever there's a change in the audio input, the SDK calls the RTCRtpSender: replaceTrack API in the browser to swap out the track that's currently in use.
Join a meeting with Web Audio disabled.
Call startAudioInput with a new audio input.
Reusing the existing microphone is okay.
In the same JavaScript code block, call startVideoInput with the MediaStream object.
Calling it with a non-MediaStream object is okay.
In the same JavaScript code block, call startLocalVideoInput.
Calling it after a 0 ms delay is okay. JavaScript executes the code in the next cycle.
Root cause:
If the above conditions are satisfied, the SDK attempts to call the RTCRtpSender: replaceTrack API twice.
At the end of the startAudioInput API.
During the update action triggered by the startLocalVideoTile API.
The SDK should call the RTCRtpSender: replaceTrack in sequence, first in (1) followed by (2). However, in the stated conditions, step (2) happens after step (1).
Description of changes:
Invoke MediaStreamBrokerObservers in the next event loop tick to fix the root cause.
Testing:
Assume that you have at least one microphone and camera configured in your system.
Ensure that the Chime SDK does not display the SendingAudioFailed event in the browser console. Other attendees should not have any issues hearing and seeing you.
Can these tested using a demo application? Please provide reproducible step-by-step instructions.
Yes. See the Testing section.
Checklist:
Have you successfully run npm run build:release locally?
Yes.
Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
No.
Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
No.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #: https://github.com/aws/amazon-chime-sdk-js/issues/2709
Conditions to occur:
Whenever there's a change in the audio input, the SDK calls the
RTCRtpSender: replaceTrack
API in the browser to swap out the track that's currently in use.startAudioInput
with a new audio input.startVideoInput
with theMediaStream
object.MediaStream
object is okay.startLocalVideoInput
.Root cause:
If the above conditions are satisfied, the SDK attempts to call the
RTCRtpSender: replaceTrack
API twice.startAudioInput
API.startLocalVideoTile
API.The SDK should call the
RTCRtpSender: replaceTrack
in sequence, first in (1) followed by (2). However, in the stated conditions, step (2) happens after step (1).Description of changes:
Testing:
Open the browser console and execute the following code:
Can these tested using a demo application? Please provide reproducible step-by-step instructions.
Yes. See the Testing section.
Checklist:
Have you successfully run
npm run build:release
locally? Yes.Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved? No.
Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved? No.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.