jspaint icon indicating copy to clipboard operation
jspaint copied to clipboard

Rewrite multiplayer mode to WebRTC

Open not7cd opened this issue 4 years ago • 3 comments

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

not7cd avatar Apr 14 '20 00:04 not7cd

I got basic functionality of sharing cursor position. I will use previous work presented here https://github.com/muaz-khan/Canvas-Designer

not7cd avatar Apr 14 '20 10:04 not7cd

I'm considering dumping FirebaseRTC in favour of socket server based on this repository https://github.com/kolson25/WebRTC-Multi-Peer-Video-Audio

not7cd avatar Apr 14 '20 17:04 not7cd

Multiplayer mode? Have I miss something?

TheAwesome98-Real avatar Jul 05 '20 22:07 TheAwesome98-Real