twilio / twilio-video.js

Twilio’s Programmable Video JavaScript SDK
https://www.twilio.com/docs/video/javascript
Other
569 stars 216 forks source link

not hide the canera and mute for the remote Participant. #2016

Open Mu-Aleem opened 1 year ago

Mu-Aleem commented 1 year ago

please help me. my hide camera and mute work only for the local Participant not for the remote Participant.

const handleAudioToggle = () => { room.localParticipant.audioTracks.forEach((track) => { if (track.track.isEnabled) { track.track.disable(); } else { track.track.enable(); } setToggleAudio(track.track.isEnabled); }); };

const handleVideoToggle = () => { room.localParticipant.videoTracks.forEach((track) => { if (track.track.isEnabled) { track.track.disable(); } else { track.track.enable(); } setToggleVideo(track.track.isEnabled); }); };

hear is my function. when i console the room. not find any RemoteAudioTrack or RemoteVideoTrack .

manjeshbhargav commented 1 year ago

Hi @Mu-Aleem ,

Thanks for writing in with your issue. Are you sure you were not the only person in the Room? That might explain why there were no RemoteParticipants and RemoteTracks.

Mu-Aleem commented 1 year ago

hi @manjeshbhargav . I'm creating a basic video call app and after connecting the call when I hide or mute my mic its mute and hide on my side only. another user can hire and see my video which is totally wrong.

const handleAudioToggle = () => { room.localParticipant.audioTracks.forEach((track) => { if (track.track.isEnabled) { track.track.disable(); } else { track.track.enable(); } setToggleAudio(track.track.isEnabled); });

 const handleVideoToggle = () => {
room.localParticipant.videoTracks.forEach((track) => {
  if (track.track.isEnabled) {
    track.track.disable();
  } else {
    track.track.enable();
  }
  setToggleVideo(track.track.isEnabled);
});

};

hear is my function which i use for the hide and mute

manjeshbhargav commented 1 year ago

@Mu-Aleem ,

Have you deployed your app somewhere where I can play around with it? Muting is a basic feature that has been working for a long time, so I would like to access your app if possible.