IEvangelist / IEvangelist.VideoChat

Imagine two Twilio SDKs, ASP.NET Core/C#, Angular/TypeScript, SignalR, etc... Yeah, amazing!
http://bit.ly/video-chat-tutorial
MIT License
67 stars 59 forks source link

Mute/Unmute video and audio track #16

Closed gauravshrestha closed 4 years ago

gauravshrestha commented 4 years ago

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.

IEvangelist commented 4 years ago

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.

gauravshrestha commented 4 years ago

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;
IEvangelist commented 4 years ago

In that case, I suggest you move this issue to the official Twilio JavaScript SDK repo: https://github.com/twilio/twilio-video.js