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

require function is not working in Asp.netcore javascript

I tried to implement WebRTC simple-peer video chat application using .net core MVC. But when writing javascript implementation that needs to make peer connection, they have used require("xxx") function and I am getting an error that required is not…
1
vote
0 answers

socket.io & simple-peer: video chatroom works for only 2 persons

i am trying to build one-to-one video chatroom with socket.io and simple-peer, it works as it should for only 2 persons and if third one connects code alerts him that there are already 2 person and s/he should wait. and thing i want to do is to add…
Kim Ber
  • 69
  • 11
1
vote
0 answers

simple-peer webrtc multiple streams in one connection

The goal is to capture the streams from an
Chris Newell
  • 137
  • 2
  • 10
0
votes
1 answer

How do I make a collaborative whiteboard using WebRTC or WebSocket?

I have created a video chat app using WebRTC and MERN. However, I wanted to add a collaborative whiteboard to the app so that when a person draws on their canvas element the same shape will appear on the other user's canvas. Session.js import React,…
0
votes
0 answers

Peer connection getting repeatedly closed in simple-peer react app

I am new to WebRTC and was making a video conferencing feature for my app using React, Socket.io, and WebRTC. I don't know why but I am having a lot of trouble with connecting the peer objects for my app. I can make and end a call between 2 peers…
0
votes
1 answer

Value of React state not updating instantly

I'm building a video calling feature into my app and the user's media stream is stored in a React state. However, when I try to access this state in another file (I'm using React Context for this), the stream state hasn't been updated yet and uses…
FaderR
  • 17
  • 1
  • 7
0
votes
0 answers

RollupError: "default" is not exported by "node_modules/simple-peer/simplepeer.min.js", imported by "node_modules/y-webrtc/src/y-webrtc.js"

I am building a CodeMirror-Yjs-editor. I followed the example in y-codemirror.next. But when I tried to rollup the JS, I got the error in the title. I tried to change dependency version but still could not get it working. Please help. Any help is…
Charles
  • 675
  • 3
  • 12
  • 21
0
votes
1 answer

Simple-peer: Video Calling App not working when peers are connecting from different systems

I have built a video calling app that enables video communication between two peers. When I open the site (hosted on Surge, server hosted on render.com) on a single system with two different tabs corresponding to local peer and system peer, I am…
0
votes
0 answers

how to render mediaStream in Video Tag getting from remote source?

Hi i build react js project for streaming live, if user1 create stream then other user can join that stream by putting it fo streamer, i use socket.io, node js , simple-peer. but issue is that i get media stream from remote source but it doest not…
0
votes
0 answers

Configure Simple-Peer for better streaming quality

I'm using simple-peer to send a 1080 video stream from one tab to another tab on the same computer. And the receiver's video quality is not as good as sender's and the resolution is also bad. How can I improve the quality of webrtc video stream and…
0
votes
0 answers

How to disconnect simple-peer connnection with socket.io in js

I have video connection with socket.io and simple-peer and I don't disconnect conference. I try disconnect() function but get error like undefined method back is laravel
Farrux Choriyev
  • 179
  • 1
  • 5
0
votes
0 answers

Steaming application with simple peer error

I am currently building a streaming application using Laravel 9, react Js, Laravel echo, pusher and simple peer but I am facing an issue on the viewer side of the application I am not able to get the streamer video and audio this is the error i am…
0
votes
1 answer

Remove access of the media devices in js

I used the getUserMedia function to get access to my camera and mic, but now I want to remove the access when I leave the particular page or component in react const stream = await navigator.mediaDevices.getUserMedia({ video: videoConstraints,…
0
votes
1 answer

Uncaught ReferenceError: process not defined simple-peer Javascript

I am currently learning WebRTC and using simple-peer an npm package with React and Socket.io . And when ever I try to Call the user is display this Error _stream_readable.js:529 Uncaught ReferenceError: process is not defined at emitReadable…
DevEnma
  • 1
  • 1
0
votes
1 answer

Socket does not work properly after deployment

I used simple Peer and react for peer-to-peer connection. And I made and distributed a video chat app that other people can participate in, and now it works in the local environment, but it doesn't work at all in the distributed environment. A…
ram
  • 11
  • 1