Current Workflow
As of SkylinkJS 0.6.3, the current workflow to handle restarts in a MCU environment for shareScreen(), stopScreen(), sendStream(), refreshConnection() will involve peers leaving and re-joining the room.
Steps in P2P (normal) environment:
- [Either: shareScreen() / stopScreen() / sendStream() / refreshConnection() ] method is invoked.
- (If there is a new stream) "incomingStream" event is triggered for self.
- "peerRestart" event is triggered for all connected Peers.
Steps in MCU environment:
- [Either: shareScreen() / stopScreen() / sendStream() / refreshConnection() ] method is invoked.
- "peerRestart" event is triggered for all connected Peers.
- "serverPeerRestart" event is triggered for MCU Peer.
- SDK invokes leaveRoom().
- "peerLeft" event is triggered for self and all connected Peers.
- "serverPeerLeft" event is triggered for MCU Peer.
- "streamEnded" events is triggered for all connected Peers that has stream.
- SDK invokes joinRoom() to the previously connected Room name.
- "peerJoined" event is triggered for self.
- (If user has stream) "incomingStream" event is triggered for self.
- "serverPeerJoined" event is triggered for MCU Peer.
- "peerJoined" event is triggered for Peers in the Room.
- "incomingStream" event is triggered for Peers that has stream.
Why is the Workflow different from the P2P (normal) scenario?
SkylinkJS introduced the restart functionality in SkylinkJS 0.5.9 and the screen-sharing functionality in version 0.6.0 that uses the restart functionality. The MCU, however, does not support restarting of connections, and by extension does not support screen-sharing. A workaround was made for SkylinkJS 0.6.3 where the MCU could support screen-sharing by leaving and re-joining the room.