Search code examples
djangoflutterdjango-rest-frameworkwebsocketvideo-streaming

Best practices to build multi room (video and chat) with permissions in django and flutter


So past couple of days I have been looking into building multi room, where users are able to either chat, spectate or make a video calls dependent on their permissions in Django(DRF) backend and flutter frontend.

For Django I found that I need to use, channels and web socket. Alternatively for flutter I found about stream platform (getstream.io) that helps to do that.

At the end of the day I got overwhelmed and confused. I do not know where to begin, or what is the best approach to what I am looking for. I am very comfortable with working DRF and using dryrestpermissions to permit users some actions, however I am not sure how to integrate that with the multi room, websockets and then access that through flutter...

Either way please give me your ideas about this, best practices and where should I begin?

Thank you!


Solution

  • You could use Django backend as room server, which is named signaling server for WebRTC. The room server used to create and manage rooms, to allow flutter clients to list the room, to enter the room and get the streams of other clients.

    While from the point of view of streaming, you should use WebRTC, rather than live streaming. Because for video chat, the lagging should <400ms, which is easy for WebRTC to do this, generally ~100ms.

    Never use live streaming, whatever neither RTMP/HLS nor LLHLS/DASH, normally >1s latency.

    If you want a fast overview, please try the demo of SRS: VideoRoom, or other WebRTC sfu like mediasoup or janus.