jspaint
jspaint copied to clipboard
Rewrite multiplayer mode to WebRTC
There are unwanted changes in index.html.
This approach still uses Firebase, but changes its role to only act as signaling. All drawing activities should be handled by WebRTC.
This would mean a major overhaul of how sessions are handled.
Proposed architecture
mesh connection: every client will communicate its local state like cursor position and if its a host
start connection: host establishes stream to every connecting remote to send them the canvas
if host leaves, peers decide which one of them takes host status and host establish new stream to other peers.
for MVP host should be able to edit the canvas, while clients can send changes that are applied by host
I got basic functionality of sharing cursor position. I will use previous work presented here https://github.com/muaz-khan/Canvas-Designer
I'm considering dumping FirebaseRTC in favour of socket server based on this repository https://github.com/kolson25/WebRTC-Multi-Peer-Video-Audio
Multiplayer mode? Have I miss something?