Mute/Unmute video and audio track
gauravshrestha opened this issue · 3 comments
Can you please post an example of how to mute/unmute tracks? I am calling disable() method on the LocalTrackPublication.Track instance, but it doesn't work properly. Any help will be appreciated.
Thank you.
Hi @gauravshrestha,
Could you please provide me with the snippet of code you're using now? Or better yet, do you have a fork of this repo with your changes on it? That would be really helpful in debugging.
Hi @gauravshrestha,
Could you please provide me with the snippet of code you're using now? Or better yet, do you have a fork of this repo with your changes on it? That would be really helpful in debugging.
Hello, I do not have a fork with this repo. I am just trying out twilio using this solution as a learning example. I am trying to mute/unmute using the javascript sdk:
Thanks for your help.
this.room.localParticipant.tracks.forEach((publication: any) => {
if (publication.kind === 'data') {
return;
}
if (this.videoOn) {
publication.track.disable();
}
else {
publication.track.enable(true);
}
});
this.videoOn = !this.videoOn;
In that case, I suggest you move this issue to the official Twilio JavaScript SDK repo: https://github.com/twilio/twilio-video.js