var webrtc = new WebRTC({ localVideoEl: 'localVideo', remoteVideosEl: 'remoteVideos', autoRequestMedia: true }); webrtc.on('readyToCall', function () { webrtc.joinRoom('My room name'); });
var peer = new Peer(); var conn = peer.connect('dest-peer-id'); conn.on('open', function () { // Receive messages conn.on('data', function (data) { console.log('Received', data); }); // Send messages conn.send('Hello!'); });