tom-james-watson / p2p.chat

p2p video conferencing powered by WebRTC.
MIT License
686 stars 134 forks source link

Add audio/video controls to device request page #58

Open wolfgang42 opened 1 year ago

wolfgang42 commented 1 year ago

So you can turn off your audio/video before joining, to avoid e.g. giving everyone horrible background noise.

WIP, known issues:

I had to do some refactoring; the commit messages should explain what’s going on.

wolfgang42 commented 1 year ago

Yeah, I confirmed that changing the device causes the stream state to go out of sync with the values in the Local atom. But I’m having trouble figuring out what the right fix for this is; it seems like right now the stream setup code is a bit scattered. I’m not very familiar with Recoil, so this might be a naïve question, but: is there a reason there isn’t a “LocalStream” atom that has {audioDeviceId, videoDeviceId, audioEnabled, videoEnabled} plus an effect to convert that into the appropriate calls to lib/mesh/stream.ts?