-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(client): receive audioLevels when joined the call with mic muted #1202
Conversation
if we have |
const defaultConstraints = this.state.defaultConstraints; | ||
const constraints: MediaTrackConstraints = { | ||
...defaultConstraints, | ||
deviceId: this.state.selectedDevice, | ||
}; | ||
stream = await this.getStream(constraints as C); | ||
this.state.setMediaStream(stream); | ||
await this.muteOrDestroyStream(this.state.disableMode === 'stop-tracks'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await this.muteOrDestroyStream(this.state.disableMode === 'stop-tracks'); | |
await this.muteOrDestroyStream(false); |
We always want to just mute the stream here, if we call it with stop-tracks
we destroy the stream that we've just created
stream = this.state.mediaStream; | ||
this.unmuteTracks(); | ||
} else { | ||
if (!this.state.mediaStream && settings && settings.createMutedStream) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do this with less copy-paste, and we can remove this whole if statement, see below
...defaultConstraints, | ||
deviceId: this.state.selectedDevice, | ||
}; | ||
stream = await this.getStream(constraints as C); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check here if we need to mute
if (settings && settings.createMutedStream) {
await this.muteOrDestroyStream(false);
}
Client Changes:
muteStream
API is changed now tomuteOrDestroyStream
.unmuteStream
API is changed tounmuteOrCreateStream
.disableTrackWhilePublish
argument that will not enable the track while publish, which currently happens every time here.