vanevery / p5LiveMedia

Simple P5 WebRTC
MIT License
69 stars 12 forks source link

Add a stop and disconnect method #8

Open vanevery opened 3 years ago

vanevery commented 3 years ago
// Doesn't exist but we probably need: p5l.stop(); p5l.disconnect();
Hamsoon22 commented 3 years ago

Dear vanevery,

p5l.stop(); p5l.disconnect(); function is a good idea!

I am using this library for my project. I really appreciate it. However, I am wondering how I can use a mute function.

'myStream.getTracks()[0].enabled = false;' is not working. Is there any other option to use mute function?

Thank you so much. Best, Yeun

vanevery commented 3 years ago

Glad it is useful for you! Yes, I need to get on those stop and disconnect methods! (Pull requests are more than welcome ;-)

For mute, I would probably do the following: myStream.muted = true; Actually, I am guessing that the myStream variable in this case is actually a p5.MediaElement in which case you'll either have to do: myStream.volume(0); or myStream.elt.muted = true;