make sure audio locally is muted so we do not hear ourselves

pull/1969/head
Audric Ackermann 4 years ago
parent 3a864b16ca
commit cade0ffeb6
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -355,7 +355,7 @@ export const InConversationCallContainer = () => {
<StyledVideoElement ref={videoRefRemote} autoPlay={true} /> <StyledVideoElement ref={videoRefRemote} autoPlay={true} />
</VideoContainer> </VideoContainer>
<VideoContainer> <VideoContainer>
<StyledVideoElement ref={videoRefLocal} autoPlay={true} /> <StyledVideoElement ref={videoRefLocal} autoPlay={true} muted={true} />
</VideoContainer> </VideoContainer>
<InConvoCallWindowControls> <InConvoCallWindowControls>

@ -184,11 +184,7 @@ export async function selectAudioInputByDeviceId(audioInputDeviceId: string) {
if (sender) { if (sender) {
await sender.replaceTrack(audioTrack); await sender.replaceTrack(audioTrack);
mediaDevices?.getAudioTracks().forEach(t => { // we actually do not need to toggle the track here, as toggling it here unmuted here locally (so we start to hear ourselves)
t.stop();
mediaDevices?.removeTrack(t);
});
mediaDevices?.addTrack(audioTrack);
} else { } else {
throw new Error('Failed to get sender for selectAudioInputByDeviceId '); throw new Error('Failed to get sender for selectAudioInputByDeviceId ');
} }
@ -274,12 +270,7 @@ async function openMediaDevicesAndAddTracks() {
track.enabled = false; track.enabled = false;
} }
if (mediaDevices) { if (mediaDevices) {
// FIXME audric why does this fails?
// track.onunmute = () => {
// if (mediaDevices) {
peerConnection?.addTrack(track, mediaDevices); peerConnection?.addTrack(track, mediaDevices);
// }
// };
} }
}); });
} catch (err) { } catch (err) {

Loading…
Cancel
Save