Questions tagged [simple-peer]

Simple WebRTC video, voice, and data channels for nodejs and browser

Homepage + docs

https://github.com/feross/simple-peer

Syntax

var Peer = require('simple-peer')

var peer1 = new Peer({ initiator: true })
var peer2 = new Peer()

peer1.on('signal', data => {
  // when peer1 has signaling data, give it to peer2 somehow
  peer2.signal(data)
})

peer2.on('signal', data => {
  // when peer2 has signaling data, give it to peer1 somehow
  peer1.signal(data)
})

peer1.on('connect', () => {
  // wait for 'connect' event before using the data channel
  peer1.send('hey peer2, how is it going?')
})

peer2.on('data', data => {
  // got a data channel message
  console.log('got a message from peer1: ' + data)
})
94 questions
1
vote
1 answer

Webrtc with multiple peers - It's establishing connection not more than four people

I'm developing a video chat application for multiple users using socket.io ans simple-peer. I'm using react for front end and node js for server. Deployed the server in heroku(Now I'm using free dynos only). I'm also using my own TURN server. It is…
Shiva C
  • 30
  • 6
1
vote
1 answer

I am trying to share a file over WebRTC but after some time it stops, and log RTCDatachannel send queue is full

let file = fileUpload.files[0]; let offset = 0; let chunkSize = 1024*1024*16; file.arrayBuffer().then((buffer) => { while(buffer.byteLength){ const chunk = buffer.slice(0, chunkSize); buffer =…
1
vote
1 answer

Simple Peer on data stream throws process not defined error

I am trying to open a data channel using simple peer. I send the signal using Firebase and am able to get the on connect function to fire. const [thisPeer, setThisPeer] = useState(); const [connectionStatus, setConnectionStatus] =…
GoghDali
  • 21
  • 4
1
vote
0 answers

Simple peer video stream not playing in proximity video call webapp

so i've been learning webrtc and made a group video call app and i wanted to convert this into a proximity video call app. users in the same room can move a dot on their p5.js canvas and if 2 dots are closer than a certain threshold then those users…
1
vote
1 answer

How to send extra data with addTrack in webRTC peer connection?

I am adding multiple tracks from different clients to the peer and I was wondering if it is possible to send extra data with addTrack to identify which track belongs to which user? Without a nominator it is impossible for me to tell which track is…
Hypothesis
  • 1,208
  • 3
  • 17
  • 43
1
vote
0 answers

How can I add mute/unmute and video on/off buttons to this simplepeer webrtc app that I built?

I was recently learning about WebRTC and simplepeer the other day, and I followed this awesome youtube tutorial: https://www.youtube.com/watch?v=R1sfHPwEH7A&list=PLK0STOMCFms4nXm1bRUdjhPg0coxI2U6h&index=2, but, I was wondering how to implement a…
bigman1234
  • 105
  • 2
  • 12
1
vote
1 answer

How to add Video track and remove it using simple-peer

I am using simple-peer in my video chat web application. If both the users are in audio call how can I add Video track and how can I disable it. If I use replaceTrack I am again which is giving this issue error Error: [object RTCErrorEvent] at…
yoonus
  • 41
  • 7
1
vote
1 answer

simple-peer with react-native-webrtc

I am trying to use simple-peer with react-native-webrtc package to create a connection. I believe this is the issue here but couldn't find any solution yet. https://github.com/feross/simple-peer/issues/109#issuecomment-576302328 Here is my client…
1
vote
1 answer

Video streaming over simple-peer (WebRTC)

I want to make a website (using NodeJS and Express deployed on Heroku) where a user can stream any of his local video (using videojs) to other users connected to each other with simple-peer currently what I got is that I make chunks of the local…
1
vote
0 answers

connection failed simple-peer after deployment

I am using simple-peer for video transmission. Its working fine in my local network so I add google's free stun server to connect with people not in my local network. But its throwing error connection failed if I try to connect to anyone outside of…
MD Jahid Hasan
  • 786
  • 1
  • 9
  • 19
1
vote
1 answer

Error: cannot signal after peer is destroyed - simple-peer

This error happens to me when I try to connect for the second time between two peers. P1 - Person 1, P2 - Person 2 It goes like this: P1 emits "Looking for partner" -> P2 emits "Looking for partner" -> Server emits to P2 "Partner found" -> P2…
Chris K.
  • 113
  • 1
  • 7
1
vote
2 answers

Simple peer and socket.io keeps sending back and forth requests 100s of times. Unable to establish signal connections

I am trying to establish a connection between the two different users on the server. Every time a users joins the room he gets the info about the socket.ids of other users in the room. What they try and do is the new user creates an initiator peer…
1
vote
1 answer

Can anyone give me an example of sdpTransform option in simplepeer

Hi I've been searching for an example of how to use sdpTransform feature in simple peer and haven't found anything yet. Also is there any way to check what codecs were used in mediaStream object. Is there anyway to create custom sdp offer in…
Haha
  • 148
  • 1
  • 8
1
vote
2 answers

simple peer webrtc remote video stream not playing

peer.on('stream', function (stream) { console.log('peer on stream called'); console.log(stream); this.video = document.getElementById("peerVideo"); this.video.srcObject = stream; …
1
vote
1 answer

simple-peer webrtc error when trying to share screen

I am building a video chat application using simple-peer where users can also share the screen. The flow of the app is such that when user A creates a room, he can grab the page url and share with user B. When user B joins, an initiator peer is…
Chaim Friedman
  • 6,124
  • 4
  • 33
  • 61