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
7
votes
1 answer

How to use simple-peer with react-native-webrtc

I'm trying to use react-native-webrtc in the constructor for simple peer import wrtc from 'react-native-webrtc'; const peer = new SimplePeer({initiator: true, wrtc: wrtc}); the error I'm getting is ExceptionsManager.js:179 Error: No WebRTC…
Walter Shub
  • 652
  • 8
  • 19
6
votes
0 answers

Create MediaStream from ReadableStream

I'm using puppeteer-stream to get a stream of a browser controlled by Node, running on a server. I am able to write this stream out to a file with no issues. I wanted to stream this stream via WebRTC to a browser (basically to see what the browser…
navinpai
  • 955
  • 11
  • 33
6
votes
1 answer

Node.js - Client to Server WebRTC with P2P

After looking to implement WebRTC with a Client to Server model (like Discord), I came to the conclusion that the way to do this is to have 2 clients - the server and client. Audio streams can be overlayed and sent back to the user in 1 single…
ADAMJR
  • 1,880
  • 1
  • 14
  • 34
6
votes
3 answers

What is the role of SFU., Janus, mediasoup or medooze. on a webRTC application

I'm using a webRTC application with a simple-peer npm package. I want to know what is the purpose of all these topics (SFU., Janus, mediasoup or medooze.) and how can I integrate them to make my application performance greater? PS: I'm using a…
CTMA
  • 63
  • 1
  • 9
5
votes
0 answers

Is is possible to list all devices connected to the same wifi network using simplepeer JS?

I'm creating a system that enables users to share files accross devices connected to the same wifi network. I would like to have a list of all connected devices so I can select which device to send to (Using simplepeer JS). I have already created a…
phi lo czar
  • 349
  • 2
  • 12
4
votes
1 answer

"what is the proper way to disconnect peers using simple-peer.js library and stop streaming between those peers? "

i hope y'all will be fine, I am a beginner in webRTC sorry if my question feels like a noob one but i was wondering that is there any proper way to close the connection among peers especially using simple-peer.js, looking forward for your awesome…
Danial Shabbir
  • 612
  • 8
  • 18
3
votes
1 answer

How to setup STUN server in a video chat app built using simple peer?

I was recently working on a project which requires video chatting. I used simple peer to setup a video call and use socket.io for signalling purposes. I then deployed my application. I realised when two peers on the same network join the call, the…
3
votes
0 answers

Cant send data over RTC data channel using simple peer

I recently tried implementing p2p file transfer using Webrtc by splitting large files into array buffers and then sending them over the data channel. The code was working a month ago, but now it is suddenly throwing me this error. Uncaught RTCError:…
Dev
  • 103
  • 1
  • 7
3
votes
3 answers

simple-peer on.("signal") event repeats many times

I'm using simple-peer to create a small video calling app using NodeJS, SocketIO and Angular I'm trying to implement full-mesh here. I have a peer initialtor which will initiate the signal on loop. My code is as below. const peer = new SimplePeer({ …
rakcode
  • 2,256
  • 4
  • 19
  • 44
3
votes
1 answer

Cannot signal after peer is destroyed . Simple-peer

I'm a beginner in webrtc . I have used simple-peer to connect two peers on a video calling application . When a second peer is connected , his video is displayed but after a few seconds an error showing "cannot signal when peer is destroyed" is…
Padma govind
  • 31
  • 2
  • 4
3
votes
0 answers

Remote offer sdp: Failed to set remote video description send parameters

I am using Simple Peer to connect 2 clients over webRTC While trying to send the offer to the receiver I am getting Failed to set remote video description send parameters. Here is the SDP {"type":"offer","sdp":"v=0\r\no=- 3967002803862387085 2 IN…
user3728728
  • 885
  • 2
  • 11
  • 14
3
votes
2 answers

How to get Simple-Peer type intellisense in Angular 6

I have installed packages via npm like npm i simple-peer npm i @types/simple-peer and then referenced it in angular.json like "scripts": [ "./node_modules/simple-peer/simplepeer.min.js" ], Simple-Peer is working fine but unable to get…
WasiF
  • 26,101
  • 16
  • 120
  • 128
2
votes
1 answer

Why onnegotiationneeded is triggered only once?

I am adding tracks to my peer and the first time onnegotiationneeded is triggered just fine. However, upon adding more tracks onnegotiationneeded is not triggered therefore the new tracks are not showing any effect. This is the main part of the code…
Hypothesis
  • 1,208
  • 3
  • 17
  • 43
2
votes
2 answers

Simple peer different network calling Issue

I am using simple peer for my video call web application. when I call people in the same network video call is working perfectly. But in the different networks, it is not working. I also added ICE servers(stun/turn) to simple peer. Still, the same…
yoonus
  • 41
  • 7
2
votes
0 answers

Uncaught Error: Connection failed. rtcpeerconnection.t._pc.onconnectionstatechange

Here Is the Reactjs Component code It works fine in the same browser after deploying to heroku but when we join room from different internets this error Uncaught Error: Connection failed. rtcpeerconnection.t._pc.onconnectionstatechange occured.I…
1
2 3 4 5 6 7