This message was deleted.
# helpdesk
s
This message was deleted.
b
Hello @worried-computer-23245, I think the code you're showing shouldn't have any impact on the audio track. It should only mute/disable the video track and leave the audio track untouched. This said, I've never tried this in react-native.
w
unfortunately it does, as referenced in the documentation above
If a track has already published, it'll mute or unmute the track.
d
I think that's just a terminology difference. there we are using
mute
to mean
disable
. the commands that you are running should not disable the mic.
w
it doesn't on react apps but it does on react-native apps, I even tried the
unPublishTrack()
method on the video track only and it still mutes the mic, tried logging
isMicrophoneEnabled
and it's always true even after the toggling the video off, but the user on the other end doesn't hear anything when the video is disabled
b
I have a feeling that, this is probably a bug.
I'm rather curious are you using
setMicrophoneEnabled()
anywhere in your code? I'd be curious to know if this gets hit.
w
yes, I'm using it when I initially connect to a room.
Copy code
// Connect to room.
  useEffect(() => {
    let connect = async () => {
      try {
        // If you wish to configure audio, uncomment the following:
        await AudioSession.configureAudio({
          android: {
            preferredOutputList: ["speaker"],
          },
          ios: {
            defaultOutput: "speaker",
          },
        });
        await AudioSession.startAudioSession();
        await room.connect(roomUrl, token);
        await room.localParticipant.setCameraEnabled(true);
        await room.localParticipant.setMicrophoneEnabled(true);
        console.log("connected to ", roomUrl, " ", token);
        setIsConnected(true);
      } catch (e) {
        console.log("ROOM ERROR: ", e);
      }
    };

    connect();
    return () => {
      room.disconnect();
      AudioSession.stopAudioSession();
    };
  }, [roomUrl, token, room]);
d
thanks for your report, we'll investigate. which version of RN sdk are you using?
w
I'm getting the package directly from githup as it's still not released I think.
"livekit-react-native": "<https://github.com/livekit/client-sdk-react-native>"
and my react-native version is
0.70.5
e
what os device is this for?
w
I've tested with ios, but I will build for both android and ios
e
hmm, tested on both android and ios, but I’m not able to repro this
could you clone our repo and try out the example app to see if this still happens for you?
d
We did publish it! give this version a try