Created
December 13, 2018 13:24
-
-
Save lazorfuzz/67f6e40566c20bd73abc37083da53e95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| join = (webrtc) => webrtc.joinRoom('my-p2p-app-demo'); | |
| handleCreatedPeer = (webrtc, peer) => { | |
| this.addChat(`Peer-${peer.id.substring(0, 5)} joined the room!`, ' ', true); | |
| } | |
| handlePeerData = (webrtc, type, payload, peer) => { | |
| switch(type) { | |
| case 'chat': | |
| this.addChat(`Peer-${peer.id.substring(0, 5)}`, payload); | |
| break; | |
| default: | |
| return; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment