Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Re-disable or disabled streams #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gfodor
Copy link
Contributor

@gfodor gfodor commented Nov 1, 2018

Before this PR, if you muted the mic via enableMicrophone(false) and then called setLocalMediaStream(stream) to say add a video track, the track replacement code re-enabled all the streams effectively unmuting you. I wasn't sure of the reason we previously were setting sender.track.enabled = true here, so perhaps this introduces a new issue, but the idea is to ensure that if the previous track was disabled we maintain that state when replacing it with a new track.

@gfodor gfodor requested a review from mqp November 1, 2018 04:18
@mqp
Copy link
Contributor

mqp commented Nov 7, 2018

This seems reasonable. Unfortunately, I also don't recall why it was important to set enabled = true here, but it makes sense that I might have missed out on testing the problem case you described, so your change may well just be strictly better than the old code.

Thanks for noticing!

@vincentfretin
Copy link
Contributor

Ah ah I was bit by this issue, now I'm using this in my code:

NAF.connection.adapter.setLocalMediaStream(mediaStream).then(() => { 
  NAF.connection.adapter.enableMicrophone(voiceEnabled);          
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants