Category : webrtc

const socket = io(‘/’); const videoGrid = document.getElementById(‘video-grid’); const myVideo = document.createElement(‘video’); myVideo.muted = true; var peer = new Peer(undefined,{ path: ‘/peerjs’, host: ‘/’, port:’3030′ }); let myVideoStream navigator.mediaDevices.getUserMedia({ video:true , audio:true }).then(stream => { myVideoStream = stream; addVideoStream(myVideo,stream); peer.on(‘call’,call =>{ call.answer(stream) const video = document.createElement(‘video’) call.on(‘stream’,userVideoStream => { addVideoStream(video,userVideoStream) }) }) }) peer.on(‘open’,id => ..

Read more