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
0
votes
2 answers

WebRTC : navigator.mediaDevices.getUserMedia not working in Chrome on Android

While I am working on basic React example with WebRTC (simple-peer) : navigator.mediaDevices.getUserMedia({ video: true, audio: true }).then(stream => { setStream(stream); if (userVideo.current) { userVideo.current.srcObject =…
Rajeev Akotkar
  • 1,377
  • 4
  • 26
  • 46
0
votes
1 answer

peer.on('signal') is calling again when I addTrack(ex.screenShare track) - simple-peer

peer.on('signal') is calling again when I addTrack(ex.screenShare track) when a video call is going on then another peer connection is establishing with this error But the replaceTrack is working fine.I am not able to figure out Can u please help…
0
votes
2 answers

How to connect to stun and turn servers using simple peer

I developed a video chatting application using simple peer and socket.io . But when I tried hosting the application the peers could not be connected because of the firewall issue . I am aware that STUN and TURN servers are to be used for this…
Padma govind
  • 31
  • 2
  • 4
0
votes
1 answer

simple-peer - Record vidoes for peer to peer calling

I am planning to use https://www.npmjs.com/package/simple-peer for peer to peer calling. But in this the two parties get connected without the media server. But I would like to record the conversation. How can I do it? I see that Zencastr is using…
Pradeep Sreeram
  • 368
  • 4
  • 19
0
votes
1 answer

No video play after reload page with simple-peer

Currently, streaming video from one client (streamer) to another (viewers) using the program has been implemented. Everything works well until the viewer reloads the page. His video disappears, although the stream was transmitted (this can be seen…
0
votes
0 answers

node-turn failing after a minute

I got my webRTC application finally connecting my AT&T cellphone to my wifi using node-turn. It seems to work great, but after a minute it always changes the state of the peer and then disconnects. This is what consistently shows in the log relaying…
0
votes
1 answer

Simple-peer, how the candidate data is transferred?

I am using Simple-peer to build a webrtc application. To establish connection, we need to first send the offer and receive the answer. After that onicecandidate event gets triggered generating the candidate, we are required to send the candidate…
Anupam Chaplot
  • 1,134
  • 1
  • 9
  • 22
0
votes
1 answer

WebRTC error using laravel and simple-peer for data channel

This is my first webRTC project so I'm very inexperienced in tracing these sorts of errors. Especially since I'm using this NPM package, I don't know exactly what to do with this error message. If you follow that link, I've just copy/pasted the…
maximus1127
  • 936
  • 11
  • 30
0
votes
1 answer

Getting error on video calling application build with simple-peer and react

Recently I made a video calling website using simple-peer,react.js and socket.io. Its working fine between laptop web browsers but I am getting below error on video calling from mobile web browser to laptop web browser. Can someone please advise…
anonymous
  • 31
  • 1
0
votes
1 answer

Error in executing 'send' on 'RTCDataChannel' simple-peer

I am trying out webrtc using the library, simple-peer. I am following this tutorial linked here on opera browser. I am facing this error when sending a small string of 'hello': Uncaught DOMException: Failed to execute 'send' on 'RTCDataChannel':…
Arush Gupta
  • 81
  • 1
  • 7
0
votes
0 answers

WEBRTC problematics with firewall rules

I developed a webrtc platform for my company using SimplePeer JS library and PHP for the server-side. It's working like a charm with STUN and TURN servers (NODE JS) in most of the cases. My problem appears when I have some big clients with…
0
votes
0 answers

In my javascript file there are two methods that contains another method that contain same name and when that function is called working Confusingly

const video = document.querySelector('video'); let client = {}; var stream; navigator.mediaDevices.getUserMedia({ video: true, audio: true }, function (stream) { stream = stream; }, function () { }) .then(stream => { …
0
votes
1 answer

Cannot stream video to peer when peer connects using simple-peer

I am using simple-peer for simplifying webrtc use and everything is working fine. But I am facing an issue where when the broadcaster starts the stream and a viewer joins the stream, no video is displayed to the viewer. But then if the broadcaster…
Ayan
  • 2,738
  • 3
  • 35
  • 76
0
votes
1 answer

WebRTC connection does not establish after successful signaling

I am using the simple-peer js library to create peer to peer connections in the browser. I have setup proper signaling through socket.io and most of the time everything works fine; hand-shake is successful and p2p connection is established. But…
0
votes
0 answers

peer-peer not connecting in all browser with peerJS

I am trying to make a simple peer to peer video chat. at first i tried using webkit, the connection was made but couldn't make webkit work for cross browser. Then I started working with peer js. I was following the feross/simple-peer package in…
Rafaeatul
  • 43
  • 8