Rewriting lib-jitsi to Dart - a few questions

If you don’t want to read this short story, there are questions below.

I’ve started to rewrite lib-jitsi-meet to dart so that I can use it with Flutter, more natively. As told in another post I started from rewrite of xmpp module. I’ve rewritten most of it so far, and a lot of questions about connecting it with WebRTC came out. I am stuck for a few days and trying to figure out what is necessary or not. I’ve made a simplified diagram of this module, and I have the bottom part mostly done (below XMPP class). When rewriting JitsiConnectionPlugin I stumbled upon JingleSessionPC and its connection the the rest of the tree. Some of those classes seem that are mostly WebRTC wrappers and I am not sure if all of them are necessary, because all of them combined are about 10k line of codes. For now, I want to make it run, and then other features can be added.

  1. JitsiTrack seems like a wrapper for WebRtc MediaStreamTrack. I looked at the code and it seems that it is not essential, isn’t it? Maybe only some parts are necessary.
  2. TreacablePeerConnection also looks like a wrapper for RTCPeerConnection. In addition to being wrapper it manages streams from WebRTC, not JitsiTrack, so it seems unnecessary.
  3. JitsiConference is like the API of this whole library but created in JitsiConnection. Is that right?
  4. There is also a lot of Maps called options, so finding all its fields is a bit hard, especially that I want to make them into classes. Also I cannot find where they are initialized. If you could tell me where I can find initialisation, it would be helpful.
  5. What do I really need to run a simple conversation?

I’ve seen some strange dependencies between classes, so I think that some of those “wrappers” can be refactored into a simple one.

I tried to make this post short, so if I made something too short to be understandable, let me know and I will expand my thoughts.


@psapek I would be interested in helping out. I have been trying to understand how to get Jitsi to work with Dart, and know a bit of WebRTC. I have used the flutter-webrtc package and managed to make mesh based calls (audio only in my use case) work for multiple participants. However, a mesh kind of network does not scale beyond 3-4 participants and hence I’ve been trying to understand how can Jitsi be used.

That sounds great! I have got it almost working with p2p. It still needs some work, so all kinds of help is welcome. I should let you know in a few days if I can open source it.

Ok cool. Happy to speak to you privately to discuss and help in general. Let me know how I can reach out / I am available on hi.kanily at gmail dot com.

hi @psapek, just wanted to check on your progress on this. Were you able to make it work?

I can connect with jitsi server and initialize connection. I obtain media stream from the other party, but it is not working (no media is transfered). I am still waiting for a response if I can open source it.

Hi @psapek, any response to open source it? Any news about its progress?

Hi @abnerh69, unfortunately, this topic died in my company, they moved their focus to other projects as it was not that important right now. In the new year, I’ll try to ask about it. It is sad because the library is almost working (at least the android part, haven’t checked ios yet), but I need some help because I am not webrtc expert and I don’t know how to solve some problems.