anoek / webrtc-group-chat-example Goto Github PK
View Code? Open in Web Editor NEWSmall but complete example of how to use WebRTC to setup voice and/or video chat between 2+ people.
License: The Unlicense
Small but complete example of how to use WebRTC to setup voice and/or video chat between 2+ people.
License: The Unlicense
Hello together.. everything is working fine, but I need some extra function. I need a function for listening to the peers without sending my own user media data. Is there any way to do this?
It looks like user streams to every user connected. If so then streaming after say 5-10 users you would hit upload limit of internet?
Package dependencies have changed (express has split its modules into separate packages, etc.), proper way to handle this is with a package.json file that allows npm to do its job -- managing packages.
Very interesting project, definitely something I'd like to put to use. When I was trying to get it running I had some issues getting the dependencies, as there was no package.json and it uses an older version of express that needs certain middleware that's no longer included. I managed to get around that, but it looks like the server app wants to send a file "newclient.html" which isn't there. I made a copy of the client.html and named it newclient.html, configured and loaded the server, but all it is displaying is a blank dark grey page. Looking at the page source, its definitely receiving the page source, not sure if its something with Chrome & Firefox or what. Any ideas?
Not sure if anybody is using this, but to make it work in 2020 you need to enable https, by adding something like:
const fs = require("fs");
var express = require('express');
// var http = require('http');
const https = require("https");
var bodyParser = require('body-parser')
var main = express()
// var server = http.createServer(main)
let privateKey, certificate;
privateKey = fs.readFileSync("selfsigned.key", "utf8");
certificate = fs.readFileSync("selfsigned.crt", "utf8");
const credentials = { key: privateKey, cert: certificate };
const server = https.createServer(credentials, main);
Also, if you want to use this across multiple machines, you need to hardcode the IP where 'localhost' is.
I made a couple of minor changes (for example getting rid of https://github.com/anoek/webrtc-group-chat-example/blob/master/client.html#L45 to make the socket.io errors go away) and I can create a PR if anybody is interested.
This was the most minimal WebRTC example I could find so far, thanks for providing this. I can confirm that it works on Linux, Mac OSX and Android.
Hi Anoek,
Original Question:
May I know how should we change stream constraint or camera in the middle of a WebRTC call?
Solved:
https://stackoverflow.com/questions/52616178/unable-to-change-camera-stream-for-webrtc-call
Thank you.
Best regards,
Jessica
Its working on localhost:8080 but when try to access on 192.168.... :8080 it says "you choose not to provide access to camera/microphone. Demo will not work"
I post this here anyway
It already says:
node -e "var express = require('socket.io');"
(node:23046) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
and when I start the server:
node signaling-server.js
info - socket.io started
/home/cryptid11/node_modules/express/lib/express.js:99
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
^
Error: Most middleware (like bodyParser) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.get (/home/cryptid11/node_modules/express/lib/express.js:99:13)
at Object.<anonymous> (/home/cryptid11/Documents/webrtc-group-chat-example/signaling-server.js:20:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
I'm trying to start from nothing with js so maybe I need to find something newer, the problem is nowadays you find only examples for webrtc where "wonderful" libraries that requires keys interface with the webrtc lib, I can't find anything easy to learn about only webrtc...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.