with-labs / popspace

Comprehensive source for PopSpace, virtual spaces for everybody
GNU General Public License v2.0
266 stars 42 forks source link

Using jitsi #5

Open chrigui opened 2 years ago

chrigui commented 2 years ago

Any thoughts on using jitsi meet instead of a paid service?

jiri commented 2 years ago

I'd love to see support for matrix (which does use Jitsi for VOIP stuff as far as I'm aware) 😄

a-type commented 2 years ago

Seems Matrix only acts as a signaling layer, and they use either P2P or a hosted service like Jitsi as the media infrastructure. For groups larger than 3-4 we've found that P2P WebRTC media starts to get unreliable, hence our usage of a media service like Twilio which provides SFUs to consolidate the incoming and outgoing network traffic.

As for Jitsi, I agree with a preference towards open-source media servers! We've also been exploring using LiveKit. I'm not finding a lot of information about the limitations of the usage of their public hosted instance. I would imagine the limitations are fairly strict, considering they're also selling "JaaS" paid hosted plans with a free limit of 25 monthly users. But since PopStage is self-hosted as separate instances instead of one product, it's possible most users could integrate with a free Jitsi plan and never worry about those limits!

Ideally, I think we'd like to create a media layer which can adapt to incorporate different media provider services with a unified API, so you could plug in whatever media service you pay for, self-host, or find for free. Implement an interface and you're good to go.

Internally on PopStage we've made some progress in this area, but it might take some work to generalize it to be used within PopSpace as well. I'll look into it.

In the meantime I would agree that Jitsi could make a better default provider. Most of our Twilio integration which would need to be replaced is here. I'm not particularly in love with how we ended up utilizing React in all of that (it ended up feeling rather over-complicated), so there's no strong preference to stick with that approach for a new media provider.

lobau commented 2 years ago

@chrigui We just pushed a change (https://github.com/with-labs/popspace/pull/12) that enables a new media stack using LiveKit by default, which is a self hosted open-source replacement for Twilio :-)

nicopace commented 2 years ago

this is amazing @lobau congratulations!! Any guidance on how to try it out? It seems documentation is not yet updated for deploying livekit+popspace together.

a-type commented 2 years ago

I'll update the main readme soon! But to fill you in now -

If you want to use livekit, remove any Twilio env vars. Then add the following vars to the container:

REACT_APP_LIVEKIT_ENDPOINT=https://your-livekit-instance.com
REACT_APP_USE_LIVEKIT=true
LIVEKIT_API_KEY=<your livekit server key>
LIVEKIT_SECRET_KEY=<your livekit secret key>

You must be using the latest release of the image. Let me know if something isn't working.