Giter Club home page Giter Club logo

open-easyrtc's Introduction

Open-EasyRTC

npm version Build Status

NPM

Open-EasyRTC is a Fork of Priologic's EasyRTC, include an EasyRTC server and client API, HTML5 and JavaScript demos under a BSD 2 license.

Original Source and Fork intent

This NodeJS open-easyrtc module version is a fork of easyrtc hosted on Github originally made by Priologic Software Inc. and available here: https://github.com/priologic/easyrtc

This fork of easyrtc module named open-easyrtc starts at version 2.0.0 in case previous the repository decides to pick up work again on version 1.x.x.

Try a Live Demo Here:

Remix on Glitch

Features

  • Install EasyRTC's WebRTC Server on your own Linux, Windows, or Mac server in minutes not days.
  • Use our EasyRTC API and sample application code to build and deploy your WebRTC app in hours not weeks.
  • EasyRTC is completely free and open source under a BSD 2 license. No usage costs or other hidden fees.

Installation In A Nutshell

  1. Install Node.js
  2. Download the EasyRTC distribution from github (https://github.com/open-easyrtc/open-easyrtc.git)
  3. Run npm install in the easyrtc directory.
  4. Enter the easyrtc/server_example directory by executing cd server_example
  5. Run npm install in the server_example directory.
  6. Start EasyRTC by running node server.js while in the server_example directory.
  7. Browse the examples using a WebRTC enabled browser. (defaults to port 8080)

Important note: Chrome will not grant access to local microphones or cameras for a page served using http except for the localhost case. See the docs/easyrtc_server_ssl.md file for instructions on serving files using https.

Step by step instructions including additional setup options can be found in /docs/easyrtc_server_install.md

Note: there is no corresponding need to install the client files specifically; they were installed as part of EasyRTC in step 3.

Documentation

All documentation can be found within the docs folder.

EasyRTC Server

EasyRTC Client

General Development

Folder Structure

  • / (root)
    • Licenses and package information
  • /api/
    • Client API files including easyrtc.js
  • /demos/
    • EasyRTC live demos and example code
  • /docs/
    • Documentation for using the API and running the server
  • /lib/
    • Required libraries
  • /node_modules/
    • Required node.js modules
    • This folder will be created during the install
  • /server_example/
    • A simple server example

Included Demos

EasyRTC comes with a number of demo's which work immediately after installation.

  • Video and/or Audio connections
  • Multi-party video chat
  • Text Messaging with or without Data Channels
  • Screen and tab sharing
  • File transfer
  • Client side video recording

License

Copyright (c) 2018, Open-EasyRTC

Copyright (c) 2016, Priologic Software Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the below copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the below copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

open-easyrtc's People

Contributors

ampc avatar chadwallacehart avatar chanduthedev avatar dam1r89 avatar dependabot[bot] avatar dryswabbie avatar ericdavies avatar fbeauchamp avatar grosmar avatar hthetiot avatar ilovett avatar kakaroto avatar kylebakerio avatar mehmetkaplan avatar michamilz avatar ne0x avatar ryoon avatar sucsessyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open-easyrtc's Issues

Code needs to be modular.

There is alot of great code here, but it is so intertwined and could use a much simpler peer object and peer handling object. I don't think the peer objects in easyrtc can be networked economically into a p2p mesh network, serverless.

clearMediaStream doesn't work in chrome

Hi, I found another bug!
clearMediaStream doesn't work in chrome (and by extension, so does setVideoObjectSrc with a null stream).
The problem is that clearMediaStream checks if the element has a src field defined and then clears it, but setVideoObjectSrc checks for a srcObject first (and on chrome, we can't create a URL from a stream and we use srcObject instead of src).
I think the simple fix is to replace the if {} else if {} else if {}; with a if {}; if {}; if {};

How to enable echo cancellation?

Mozilla tells me the process looks like this:

 navigator.mediaDevices.getUserMedia({
    audio: {
      sampleSize: 8,
      echoCancellation: true
    }
  })

But looking through source, I don't see that as an option anywhere, nor a way that it is exposed to add these options.

// in self.getUserMediaConstraints...     
  if (!self.audioEnabled) {
            constraints.audio = false;
        }
        else {
            if (adapter && adapter.browserDetails && adapter.browserDetails.browser === "firefox") {
                constraints.audio = {};
                if (self._desiredAudioProperties.audioSrcId) {
                    constraints.audio.deviceId = self._desiredAudioProperties.audioSrcId;
                }
            }
            else { // chrome and opera
                constraints.audio = {mandatory: {}, optional: []};
                if (self._desiredAudioProperties.audioSrcId) {
                    constraints.audio.optional = constraints.audio.optional || [];
                    constraints.audio.optional.push({deviceId: self._desiredAudioProperties.audioSrcId});
                }
            }
        }
return constraints

// later...
        var mode = self.getUserMediaConstraints();
// later...
        navigator.getUserMedia(mode, onUserMediaSuccess, onUserMediaError);

I do see

if (self._presetMediaConstraints) {
            constraints = self._presetMediaConstraints;
            delete self._presetMediaConstraints;
            return constraints;
        }

at the top of getUserMediaConstraints, but instead of enabling composing an option in, it will block execution of the rest of the function, which doesn't seem ideal...

How should I approach this within easyrtc?

Some user experience

Hey there, I am using open-easyrtc for audio and messages and I want to share the experience for to know something more maybe about what can be improved.
So if I use 2.0.15 as a starting point, I can get it to work. Propably I lack expertise on node to decently give some information. To me it seems the connection is attempting to use wss:// in the first place in my setup and then switches to https://. This brings an error message in the browser console: "index.js:83 WebSocket connection to 'wss:// ... ' failed: Error during WebSocket handshake: Unexpected response code: 400
If I start git clone and not the package client connections fail silently.
Apart the files as in "use this server_example folder only without parent folder" cannot be the current socket.io.js to copy from the corresponding node_modules/socket.io-client/dist/ directory, but I am not sure if I get things right here. I serve easyrtc.js and socket.io.js from another place and use server_example and in the end it surprisingly works, currently only with the error message above.
Hope that is supportive.

Send as MediaStream the canvasCtx.captureStream(FrameRate)

Instead of video stream can I send the captured canvas ?

const canvas = document.getElementById('my-vfx-video-canvas');
const ctx = canvas.getContext('2d');
var newVideoStream = ctx.captureStream(30); 

where 30 is the frame rate for capturing the canvas.
My canvas has also transparent pixels, will they be transferred as transparent ? In which line should I set it ?
Can you support it in the next version ?

Best,
Dimitrios Ververidis @ MediaVerse project

Using open-easyrtc client in Electron with nodeIntegration=true

I'm evaluating the open-easyrtc client for use in Electron. When I set "nodeIntegration" to "false" in the BrowserWindow it works just like it would on a website (vanilla JS). However, I want to enable "nodeIntegration". With this I need to import the open-easyrtc client as Node.js module. The following steps were necessary.

(1) require("open-easyrtc"); does only import the server-side part, therefore is not needed.

(2) In the folder "node_modules" of your project copy the open-easyrtc folder and rename it to "easyrtc", open the index.js file and change the require to "./api/easyrtc".

(3) In "node_modules/easyrtc/api" open the easyrtc.js file and change "require('socket.io')" to "require('socket.io-client')" which was in line 5602. Otherwise the "io.connect" method will not exist. Also delete everything starting from line 11448 to 11917. Otherwise "easyrtc" is not available as module.

(4) In the folder "node_modules" copy the open-easyrtc folder and rename it to "easyrtc_lang", open the index.js file and change the require to "./api/easyrtc_lang".

(5) Tell easyrtc the serverName and serverPort to connect to with the method "easyrtc.setSocketUrl("http://localhost:12001");".

Would it be possible to provide these client node packages with npm? Maybe rename them to "open-easyrtc-client".

Thanks for your work on open-easyrtc!

easyrtc doesn't request permissions to capture video anymore

A consequence of this commit :
923081a

(even with the fixed typo from 220b8db)

My users have started complaining that it never asks for permissions to capture from the camera (audio doesn't seem affected by the change), tested on Chrome and Safari (Windows 10, iOS).
This also broke the feature of setting the deviceID to "default" to make it use the default camera, since it's not an exact id match anymore.

I assume it doesn't ask for permissions anymore because unless you have the exact id of the device, you can't request it to use it, and if you're not requesting the exact id, it won't ask for permission to use it. And without being given permissions, you can't know the id. So it's a chicken and egg problem.

I'll soon be using easyrtc._presetMediaConstraints to set min/max resolutions for capturing from the camera anyway, so it won't be a problem for me, but I thought you should know.

A Mistake in the code comments

When I go through the code demo_ice_filter.js, I see a mistake while commenting on the function iceCandidateFilter,where different types of sdp are separated.

function iceCandidateFilter( iceCandidate, fromPeer) {
   var sdp = iceCandidate.candidate;
   if( sdp.indexOf("typ relay") > 0) { // is turn candidate
       if( document.getElementById("allowTurn").checked ) {
           return iceCandidate;
       }
       else {
           return null;
       }
   }
   else if( sdp.indexOf("typ srflx") > 0) { // is turn candidate
       if( document.getElementById("allowStun").checked ) {
           return iceCandidate;
       }
       else {
           return null;
       }
   }
   else if( sdp.indexOf("typ host") > 0) { // is turn candidate
       if( document.getElementById("allowLocal").checked ) {
           return iceCandidate;
       }
       else {
           return null;
       }
   }
   else {
      console.log("Unrecognized type of ice candidate, passing through: " + sdp);
   }
}

Maybe they should be stun and local

Open-EasyRTC aka EasyRTC Free of Priologic

Fork Location and Name

Mobule name: open-easyrtc
Github URL: https://github.com/open-easyrtc/open-easyrtc
NPM URL: https://www.npmjs.com/package/open-easyrtc

Original Source and Fork intent

open-easyrtc module is a fork of easyrtc hosted on Github originally made by Priologic Software Inc. and available here: https://github.com/priologic/easyrtc

This fork of easyrtc module named open-easyrtc starts at version 2.0.0 in case previous the repository decides to pick up work again on version 1.x.x.

The main reason of the fork is that Priologic Software Inc. as been trying to make the main contributor @hthetiot pay for allowing major issues and security fixes to be released on NPM registry to the community and the maintainer that closed more than 200 issues and contributed more than 80 Pull-Request past 3 years, do not agreed with that kind crooked open-source of practices.

Full change Logs

open-easyrtc v2.0.0 compared to easyrtc v1.1.0 published 3 years ago

git log v1.1.0...HEAD --pretty=format:'- https://github.com/open-easyrtc/open-easyrtc/commit/%H %s' > diff.log

  • f16db6f update README.md and package.json
  • 63ec642 fix tests/api and root package.json to use open-easyrtc module name and move away from bower
  • f591321 fix tests/api and root package.json to use open-easyrtc module name and move away from bower
  • ba79e93 Merge branch 'master' into beta
  • 1544338 Update README.md
  • 5fc84c9 Update README.md
  • f636595 add npm run cleanup scripts
  • d0fe275 rebuild api/easyrtc.js from api/easyrtc_int.js
  • 581e141 fix newPeerConn.pendingAwnser bad workflow, fix supportsGetUserMedia undefined navigator.mediaDevices, fix console.log anadd more logDebug, use self.showError on missing callFailureCB
  • 29d8209 update npm dependencies socket.io@2 and npm audit express issues
  • f8147ee update bower socket.io-client to version 2.2.0
  • 4feafc8 Merge branch 'beta' of github.com:priologic/easyrtc into beta
  • 04e04c8 rebuild api/easyrtc.js file from api/easyrtc_int.js
  • 9d36d74 use receivedMediaConstraints.mandatory.(OfferToReceiveVideo|offerToReceiveAudio) only if chrome and version prior 65
  • 900870e Merge pull request #433 from priologic/features/webrtc-apater-update
  • 5ea6977 Merge pull request #415 from priologic/beta
  • 8270e17 update from webrtc-adapter to https://github.com/webrtcHacks/adapter.git#v7.2.1 (bower version stop at 6.4.0)
  • a6e1bee Update index.html
  • f74e557 Merge branch 'master' of github.com:priologic/easyrtc
  • 1ff0b0b fix demo browser version style
  • e865a4d Update README.md
  • 94a923d update server_example Dockerfile and server_ssl example
  • 34e422b update server_example/Dockerfile to use master branch
  • 5e7d9f1 update/sync demo header menu and update browser version details
  • f0d05bc update demo_data_channel_filesharing with input file for mobile testing
  • 686b3b0 update demo pages with Edge, Safari Desktop and Mobile supported demos and browsers version details
  • 3fda68f add TODO 'Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack' for Safari
  • 3b07e3c update demo_recording to allow client with no recording support to connect to demo for remote peer demo recording
  • cde02de Merge pull request #358 from priologic/updateWebrtcAdapter
  • e101543 build api/easyrtc.js using webrtc-adapter 6.4.0
  • 708e1a7 Merge branch 'master' into updateWebrtcAdapter
  • dc52b31 Merge pull request #413 from priologic/jshint
  • b113e69 fix security warning from npm 24 vulnerabilities (18 low, 6 high) to 4 vulnerabilities (2 low, 2 high) dev package have issue left only not build
  • d200a8d jshint master
  • b1ab5dd merge master and upgrade to webrtc-adapter ^6.4.0
  • 00c4cdf Merge pull request #375 from priologic/beta
  • 435fe1e Update README.md
  • 4f87d59 Update README.md
  • 9ae40c6 Merge pull request #390 from priologic/feature/docker-easyrtc-server
  • 4a76394 Update README.md
  • 6528c98 Update README.md
  • 1aad979 Merge branch 'feature/travis' into beta_priologic
  • 0429c67 Merge pull request #393 from hthetiot/feature/travis
  • 017e76c make demos and sample server non path absolute
  • 3477b5a make demos and sample server non path absolute
  • d95ce2a update docker stack
  • 4af297a Merge branch 'feature/travis' into feature/docker-easyrtc-server
  • 4439133 fix travis build
  • 338a4b3 update api/easyrtc.js build
  • f78bd11 Merge branch 'feature/travis' into feature/docker-easyrtc-server
  • a03f8fd remove phantomjs for karma and enable bower install postinstall hook on non production env
  • 11bbcfd remove phantomjs for karma and enable bower install postinstall hook on non production env
  • d0a2353 fix bower install warning
  • 7b6f728 use feature/docker-easyrtc-server branch for docker-compose
  • d9b85d7 Merge branch 'feature/screenshare' into sylaps/easyrtc-server
  • 941d756 Merge branch 'feature/travis' into sylaps/easyrtc-server
  • a6ccde7 jshint lib and api
  • fb721fe lint css
  • 20b3a9f jshint api
  • 84f7fa8 jshint lib
  • 0b611a3 htmllint demo
  • bbf4c4b jslint api/easyrtc_int.js
  • cc25194 re-implement easyrtc.setScreenCapture
  • c33b12a add travis build support
  • 9490a87 add easyrtc server example docker and docker-compose sample
  • 964e5fa Merge branch 'priologic_master' into beta_priologic
  • c57fdd3 Merge pull request #374 from hthetiot/bugs/ERR_SERVER_ALREADY_LISTEN
  • fc9a061 fix regression from #112
  • 49ccfd6 Merge pull request #370 from grosmar/beta
  • dd10025 Update easyrtc_server_install.md
  • 662d8d2 Update easyrtc_server_install.md
  • 9cde922 removed duplicated call (as it's already called through dispatching
  • 0886fbc notify about ghost connection is terminated
  • 21d7ec9 Merge pull request #1 from priologic/beta
  • e122498 Merge pull request #366 from ne0x/bugs/unnableReconnect
  • 8241e97 #364 reset missedAliveResponses to 0 when self.webSocket.on("connect", ...) to allow reconnect after newwork problems
  • c7ef7dd Merge branch 'beta' of github.com:priologic/easyrtc into beta_priologic
  • 5727388 fix missing hasFieldValueSync return
  • 3a41b7e Merge branch 'beta' into updateWebrtcAdapter
  • 78cc65c fix bower.json extra comma
  • 3d51375 remove duplicate dependencies webrtc-adapter from bower, shoyld only be in devDependencies for build
  • eef8662 rebuild api/easyrtc.js with last changes
  • 8747423 revert 'restore easyrtc._desiredVideoProperties.screenCapture support'
  • beca540 fix addStreamToPeerConnection by only add stream or stream's tracks if not added already, fix low-bandwidth demo by removing easyrtc.renegotiate addStreamToPeerConnection call, cause that not expected if peer want to renegotiate only to not add shared local streams on top of it, addStreamToCall should be use instead
  • 756a3de Merge pull request #357 from priologic/bugs/preferBitRateFirefox
  • acdd65e Revert "restore easyrtc._desiredVideoProperties.screenCapture support (update build)"
  • 9fbc385 update to [email protected] remove duplicate webrtc-adapter in bower.json
  • bdfc445 fix firefox TIAS value to (bitrate >>> 0) * 1000 vs AS
  • fcb3200 use TIAS SDP modifer instead of AS if firefox used in easyrtc_rates preferBitRate
  • 830b6e4 fix Cannot read property 'room' of undefined on generateRoomDataDelta
  • ab208ec Merge branch 'beta' of github.com:priologic/easyrtc into beta
  • 6487036 make eastrtc_recorder and easyrtc_rates use easyrtc.debugPrinter instead of console.log
  • 9b05279 Merge pull request #355 from priologic/bugs/playsinline
  • b412738 add missing playsinline=playsinline for ios auto play safari support
  • 35d64ab restore easyrtc._desiredVideoProperties.screenCapture support (update build)
  • 52c4e6b restore easyrtc._desiredVideoProperties.screenCapture support
  • 9c6eaec Merge pull request #344 from grosmar/fix_adapter_dependency
  • 5a65e1c fixing webrtc-adapter devDependency version
  • 92e6d01 Merge branch 'beta' of github.com:priologic/easyrtc into beta_priologic
  • d822116 update bower dependency to webrtc-adapter^5.0.6
  • 80e4e03 added support for RTCPeerConnection.addTrack and updated createOffer/createAnswer to use promises. Needed for Safari support
  • 91562d0 Added server_ssl.js for testing and updated doc examples to use easyrtc in parent directory
  • b19e113 updated change log
  • d6a10be commited the correct FAQ file
  • 55b3030 Merged zombie land into beta, added a bit to FAQ
  • 109b40b fix URL.createObjectURL(stream) is deprecated! Use elem.srcObject = stream instead
  • b5af661 use webrtc-adapter 4.1.1 (note: 4.2+ is breaking multi-stream)
  • 0731cef Merge pull request #322 from hthetiot/typescript2
  • 900ac16 updated from using navigator.getUserMedia(constraints,successcb,failurecb) to navigator.mediaDevices.getUserMedia(constraints).then(successcb).catch(failurecb).
  • 215dfd0 removed multstream_no_iframe from index.html since it's not really supported. added comment and url for browser extension to multilstream_iframe
  • 84fea24 #306 - applied Chpasha's fix to support Temasys plugin
  • 9e66980 fix easyrtc.d.ts RTCPeerConnectionConfig missing type
  • 99d8e74 fix tsconfig.json ident
  • 23619de remove TypeScript DefinitelyTyped files for RTCPeerConnection cause part of node_modules/typescript/lib/lib.dom.d.ts using TypeScript 2.3.4
  • e65424a Merge pull request #313 from hthetiot/beta
  • ea10b69 Merge pull request #317 from ryoon/fix-typo-in-client-tutorial
  • 0a903ed Fix broken tag
  • e984a83 fix possible bad PeerConnection state on create-answer failure
  • 0b25dce Merge pull request #312 from hthetiot/beta
  • 8f76489 update to webrtc-adapter latest stable 3.3.4
  • b7d052e Merge pull request #311 from dam1r89/master
  • 1e5ba06 Merge pull request #299 from hthetiot/beta
  • b2e3537 - Setting credential bug fix - Add getting credential method
  • e9418a7 roomApiFieldTimer was being cleared instead of an element of it
  • ce145f9 setRoomApiField needed a map of timers to handle multiple rooms
  • 6d6974c updated webrtc-adapter and modified demo_multistream to allow selecting the audio source
  • 37e4b58 added restartIce method
  • fb22aac got rid of warning message about element not connected to root
  • 0e69b9f fixed bug in candidate caching introduced by last commit
  • 8591be4 Added support for halfTrickleIce
  • 54ee188 removed obsolete code for screen capture
  • 080f699 clarified where ice server entries go
  • db89c84 got rid of obsolete demo code
  • bba9560 Cleaned up the logic behind addStreamToCall, added removeStreamFromCall, fixed multistream demos to make unique stream names
  • f8abe08 Merge branch 'zombieland' of https://github.com/priologic/easyrtc into zombieland
  • 7b5bb4b Added bit rate controls to the media recorder wrapper
  • 694ea75 Fix issue where server's connectionObj.getUsername() didn't return a null if the connection object had no username.
  • dc2333d New disconnect() function from sever code's connection object to allow for more graceful connections. Does not actually disconnect the socket.io socket (this is left to app).
  • 8c319cf Bug fix - Callback was called twice
  • eda7e95 Merge branch 'zombieland' of github.com:priologic/easyrtc into zombieland
  • 0ed579f #302 Added methods to obtain connected easyrtcids with a given username
  • ffd8d26 fixed SessionDescription bug and IceCandidate bug
  • 803968e fix Uncaught TypeError: Reduce of empty array with no initial value
  • 400fcd2 pass stillAliveInterval from server. detect lack of still alive response on client
  • a24ab87 missed add from previous commit
  • 4fea65c Added a stillAlive ping type message to help catch zombies. Added more code to remove them. Added some guards in the server
  • 3b044a9 Issue#292
  • 5c3f1a5 Fix for issue#285
  • 926c344 Fixed issue#289
  • 73f082d Revert "Added some special case logic to support use with cordova/ios-rtc"
  • e24426c A few document fixes
  • f33d949 Added some special case logic to support use with cordova/ios-rtc
  • 473f462 Merge branch 'beta' of github.com:priologic/easyrtc into beta_priologic
  • b78fbac Merge branch 'beta_priologic' into beta
  • fa98dd1 use last webrtc-adapter to restore previous easyrtc.js build
  • 34e9d63 Merge branch 'beta_priologic' into beta
  • 7b12c28 prevent possible JS Error: Cannot read property 'pc' of undefined
  • 142e05c Merge pull request #284 from ampc/patch-1
  • 30ee620 removed / from in front of .idea in .gitignore
  • 3eaa356 removed .idea folder
  • c2d5229 Update README.md
  • aaa18dc Added definitions for easyrtc_ft code
  • 82d1bfd Fixed another documentation bug
  • 5966c74 Fixed an inline documentation bug
  • f678f9f got rid of hidden files
  • 214385f Initial commit of typescript support
  • 5ca21eb exposed the standardStatsFilter member and added a demo for statistics
  • 62ae7b3 Merge pull request #283 from michamilz/patch-1
  • 6f09631 fixed link to Authentication doc in readme.md
  • b221da5 removed more .gitignore files
  • 9f6928c removed .gitignore and readded directory
  • 7018ae2 Added the properly linked html documentation
  • a4c6562 added empty lines before lists in changelog
  • 9bc8edb Merge branch 'beta' of https://github.com/priologic/easyrtc into beta
  • daa7e92 fixed links to point to https
  • 89d2e13 Merge pull request #277 from hthetiot/jshint
  • 2a8b1e9 Fixed variable initialization issue.
  • 613e92b Bumping version to 1.1.1-beta
  • 3cc82ca handle WebRTC platforms that do not have ontrack event and still use onaddstream
  • 70be0b1 exclude api/easyrtc.js from jshint
  • 53c184f lint api/labs
  • be1e0c6 lint lib/easyrtc_public_obj.js
  • 4d115c8 lint lib/easyrtc_default_event_listeners.js
  • bf548fc lint lib/general_util.js
  • 3ec044e lint lib/easyrtc_server.js
  • f445ce1 Merge pull request #274 from hthetiot/issue-231
  • cde074d Merge pull request #276 from hthetiot/beta
  • 0ab3efa fix streamName for onStreamClosed and streamAcceptor, fix issue with multi-named streams
  • c908fc1 fix Uncaught Exception [TypeError: Cannot read property 'room' of undefined]
  • 66d6985 Fix DOMException: The play() request was interrupted by a new load request. #231

Native Android and iOS Support

We want to use your library for some features in our mobile app both on Android and iOS.
The app is written in java and swift respectably.
I can't find any information if our team could help in this case?

crash when trying to enumerate devices over http

getSourceList called by the getVideoSourceList, getAudioSourceList and getAudioSinkList calls enumerateDevices on mediaDevices without checking that mediaDevices exists. The .catch() is not helpful when there is no promise created. You should check for navigator.mediaDevices && navigator.mediaDevices.enumerateDevices like you do with supportsGetUserMedia.

Default STUN options are invalid

The default stun options from lib/easyrtc_default_options.js have :

option.appIceServers = [                                    // Array of STUN and TURN servers. By default there is only publicly available STUN servers.
    {urls: "stun:stun.l.google.com:19302"},
    {urls: "stun:stun.sipgate.net"},
    {urls: "stun:217.10.68.152"},
    {urls: "stun:stun.sipgate.net:10000"},
    {urls: "stun:217.10.68.152:10000"}
];

Those are invalid because you use urls instead of url and since the code in api/easyrtc.js does this :

            item = iceConfig.iceServers[i];
            if( item.urls && item.urls.length ) {
               for( j = 0; j < item.urls.length; j++ ) {
                  processUrl(item.urls[j]);
               }
            }
            else if( item.url ) {
               processUrl(item.url);
            }

It will try to process each character as a url which will fail, so the easyrtc._stunServers end up being empty.

socket.io doesn't return Access-Control-Allow-Origin header when Origin header is sent so can't use EasyRTC across domains

I have a PHP application that I'd like to use EasyRTC with for real-time video chat. According to the docs this should be possible. I followed the instructions in the documentation, but when I try the demo_audio_video_simple.html demo on the PHP-based site I'm having CORS problems with requests to /socket.io:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://easyrtc.example.com/socket.io/?EIO=3&transport=polling&t=NrdrOhi. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

If I look at the headers that /socket.io is sending back in the Firefox developer console I can indeed see that it's missing the Access-Control-Allow-Origin header:

Request:

GET /socket.io/?EIO=3&transport=polling&t=NrdmVI9 HTTP/2
Host: easyrtc.example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: */*
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
Origin: https://game.example.com
Connection: keep-alive
Referer: https://game.example.com/
Cookie: io=dRSRi4KXvEL_Kbv5AAAN
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Pragma: no-cache
Cache-Control: no-cache
TE: trailers

Response:

HTTP/2 403 Forbidden
content-type: application/json
date: Sun, 28 Nov 2021 18:15:04 GMT
server: LiteSpeed
X-Firefox-Spdy: h2

However, if I copy and paste the URL being requested directly into the browser address bar, I do get a different set of headers back in response - including Access-Control-Allow-Origin:

Request:

GET /socket.io/?EIO=3&transport=polling&t=Nrdh9pB HTTP/2
Host: easyrtc.example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: io=vUC3lEXxioP0McRMAAAy
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Pragma: no-cache
Cache-Control: no-cache
TE: trailers

Response:

HTTP/2 200 OK
content-type: text/plain; charset=UTF-8
access-control-allow-origin: *
set-cookie: io=vcL_-LefN1utSBaRAAAz; Path=/; HttpOnly; SameSite=Strict; secure
content-length: 103
date: Sun, 28 Nov 2021 18:44:31 GMT
server: LiteSpeed
X-Firefox-Spdy: h2

Unfortunately, I'm afraid I don't know my way around Node.js enough to figure out what exactly might be causing this. Running the demos directly from easyrtc.example.com works fine; this domain has been configured via cPanel's application manager to run ~/open-easyrtc-2.0.11/server_example/.

I've noticed that if I edit the request and remove the Origin header and re-send it, the server responds with Access-Control-Allow-Origin. When running from the same domain the Origin header is not sent either, so the demo works.

I tried modifying server_example/server_ssl.js to include io.set('origins', '*:*'); or io.origins('*:*'); as some other sites have reported that this is required for CORS with Socket.IO prior to version 3 (and as far as I can see EasyRTC is using version 2.4.0) however this made no difference and the fact that the Access-Control-Allow-Origin: * header is sent when navigating to /socket.io via the browser's address bar makes me think that this sort of workaround would not be required.

Any guidance would be much appreciated, thank you!

Doing Demos

So, I'm impressed. It works. Demos work. They do something. However, I am unable to locate any details of the WebRTC peer connection. I do not see the pc object, the SDP(local description) remoteDescription, ...nothing that looks like WebRTC. All I see is a socket connection. Please explain whats going on here. You are the genius of this working thing!

Your browser doesn't appear to support WebRTC

Hi All,

I'm approaching to WebRTC.
I've installed the demo server, but when I try to connect to a demo app, with Firefox and Chrome, I've this error message:
Your browser doesn't appear to support WebRTC.

I've Mint with Firefox 69 and Chrome 77.
I've another Mint installation working without errors.
What's the problem?

Thank you!

Using library in Android/iOS App with Ionic and Angular

We want to use your library for some features in our mobile app both on Android and iOS.
The app is build with Ionic 4 and Angular 9 and is written in Typescript.
I can't find any information if our team could use your library in this case.
I've seen that the Priologic library once did support typescript in a beta version but it kinda never worked with higher versions of angular.
Can you help me out?

ES modules + rollup

First of all thank you for the forking this library and making it alive.
I want to propose to refactor the code step-by-step for using with es-modules (https://caniuse.com/#feat=es6-module) and the rollup that has first-class es-modules support.
From my side I want to propose my active support as a contributor for this features. Just share your thoughts about it.

Unable to switch cameras

Hi,

Using the following code to try to switch cameras on mobile.

function switchMedia2() { //let stream = $("selfVideo")[0].srcObject; // throws undefined error let stream = easyrtc.getLocalMediaStreamByName(); let tracks = easyrtc.getLocalStream().getTracks(); tracks.forEach((t) => { stream.removeTrack(t); stream.addTrack(tracks(1)); window.alert("IN"); }); window.alert("OUT"); easyrtc.renegotiate(otherEasyrtcid); }
The above is throwing error - "removeStream is deprecated, please use removeTrack instead."

Could someone kindly help out with a function to switch cameras.......

Regards,
Pranjal

PS: Got the code from https://github.com/open-easyrtc/open-easyrtc/issues/20

Black Screen is Received from Peer when addStreamToPeerConnection Method is Used On Apple Device

Question says it all.
I start the call with front camera. And I need to change it to back camera after a button click. I know that I can't use multiple camera streams on apple safari.

I'm using this method;

if (isApple) {
			navigator.mediaDevices
				.getUserMedia({
					video: {
						facingMode: 'environment'
					},
					audio: true
				})
				.then((backStream) => {		
					addStreamToPeerConnection(backStream, easyrtc.getPeerConnectionByUserId(theirID));
					$('#selfVideo')[0].srcObject = backStream;
				})
				.catch((err) => {
					alert(err);
				});
		}

addStreamToPeerConnection()

function addStreamToPeerConnection(stream, peerConnection) {
	alert(stream);
	if (!isApple) {
		var existingStreams = peerConnection.getLocalStreams();
		if (existingStreams.indexOf(stream) === -1) {
			peerConnection.addStream(stream);
		}
	} else {
		var existingTracks = peerConnection.getSenders();
		alert(JSON.stringify(existingTracks));
		var tracks = stream.getAudioTracks();
		alert(tracks);
		var i;
		for (i = 0; i < tracks.length; i++) {
			if (existingTracks.indexOf(tracks[i]) === -1) {
				peerConnection.addTrack(tracks[i]);
				alert(i);
			}
		}
		tracks = stream.getVideoTracks();
		for (i = 0; i < tracks.length; i++) {
			if (existingTracks.indexOf(tracks[i]) === -1) {
				peerConnection.addTrack(tracks[i]);
				alert(i);
			}
		}
	}
}

The camera-source changes on Apple user since we're just changing the srcObject of the selfVideo video element. But the user on the other end does not receive the changed stream. It's just a black stream.

How can I solve this problem? I'm really frustrated because of this differences that Safari has. On android phones, everything works just fine but on Safari, it's all crazyness.

desktop capture plugin

The demo for desktop capturing says a plugin is required to be installed in chrome in order to screen share, however the link to the plugin is dead.

I also can't find anything in the chrome web store for something called screen-capturing? is there a new link? or is this feature dead for now?

Apparent incompatibility with newer versions of the socket.io-client library [4.1.1]

Relevant Versions

  • Node.js 14.15.1
  • open-easyrtc 2.0.9
  • socket.io-client: 4.1.2

Description of Issue

open-easyrtc appears to have been written with socket.io-client version 2.4.0 in mind. The latest version of this package is 4.1.2 and it appears to no longer be compatible with the client API provided by open-easyrtc.

The easyrtc library expects to either call io.connect to establish a socket connection as part of the easyrct.connect workflow, or be provided an existing connection explicitly via easyrtc.useThisSocketConnection.

The object returned by io.connect has no json attribute - but there are 6 locations in the easyrtc.js client code which reference self.webSocket.json.emit() which procudes a TypeError as follows:

image

This error occurs regardless of whether I construct a socket connection manually or allow easyrtc to create one on my behalf using easyrtc.connect. In both cases - immediately prior to the error message self.webSocket is defined, and self.webSocket.connected === true.

Potential Solution Paths

Replacing webSocket.json.emit() with webSocket.emit() directly does not directly solve the problems I'm experiencing, as I encounter further downstream errors which I have not yet diagnosed - but it does succeed in establishing a connection with the server.

socket.io removed "attach" and "listen" in version 4.4.1 so all examples fail

The example I am using contains the following two lines.

var socketIo = require("socket.io");        // web socket external module
...
var socketServer = socketIo.listen(webServer, {"log level":1});    # this is line 40 
// var socketServer = socketIo.attach(webServer, {"log level":1});

This results in the error that socketio has no function listen. Replacing listen with attach, results in a similar error.

Note the docs for socket.io claim both still exist - see https://socket.io/docs/v4/server-api/#serverattachhttpserver-options
and https://socket.io/docs/v4/server-api/#serverattachhttpserver-options.

ian@dia:~$ pm2 list
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
ian@dia:~$ pm2 start /var/www/open-easyrtc/server/server.js
[PM2] Starting /var/www/open-easyrtc/server/server.js in fork_mode (1 instance)
[PM2] Done.
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ server    │ default     │ 2.0.14  │ fork    │ 8460     │ 0s     │ 0    │ online    │ 0%       │ 31.4mb   │ ian      │ disabled │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
ian@dia:~$ pm2 list
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ server    │ default     │ 2.0.14  │ fork    │ 0        │ 0      │ 15   │ errored   │ 0%       │ 0b       │ ian      │ disabled │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
ian@dia:~$ cd ~/.pm2/logs
ian@dia:~/.pm2/logs$ ls
server-error.log  server-out.log
ian@dia:~/.pm2/logs$ tail -20 server-error.log 
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
TypeError: socketIo.attach is not a function
    at Object.<anonymous> (/var/www/open-easyrtc/server/server.js:40:29)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
ian@dia:~/.pm2/logs$ 

Features

Hi,
Just started playing with this software and loving it. I wanted to know if it supports

  • Server-side recording
  • Active speaker
  • Transcription
  • SIP integration

Also, I created server_spdyhtml2.js for server_example. Should I create a PR for that?

connect failure never fired

The connectToWSServer calls io.connect then listens to the 'error' event, which is never called in case of a connection error, so a wrong server path yiels to the errorCallback never being called.
Listening to the 'connect_error' is I believe the proper way to check for connection erros. However, if the socket is created with reconnection attempts, it will send a connect_error at each reconnection attempt, in which case, listening to 'recconect_failed' would be the proper way of handling it :

      addSocketListener('error', handleErrorEvent);
      if (connectionOptions.reconnection !== false)
        addSocketListener('reconnect_failed', handleErrorEvent);
      else
        addSocketListener('connect_error', handleErrorEvent);

Note that by default, reconnection is true and set to reconnect an infinite number of times, which is why I only check for reconnection !== false in the connectionOptions. I also don't know if it would be a good idea to just force reconnection to false in the connectionOptions, overriding whatever was passed by the user.

Auto answering help needed (+ sending messages from server to clients)

First thank you for awesome tool, i'm currently looking through code and finding "audio only" demo very useful for my scenario, but maybe you could point me in right direction about what i had in mind, basically im planing on using open-easyrtc in such way that it will be connection with 1 raspberry pi (which will be server), and 10-15 other computers, all in local network. basically i would need somehow to make RPI server to accept call immediately without need to answering manually when somebody calls it, but also if there is already some kind of flag or boolean within the existing code which i would be able to use to show other users on html page that server is currently busy in active call with someone else and unable to accept other calls, any advice would be great

Edit: also since all the callers get random id strings on each reload, and i want them only to be able to call RPI server and not make calls between each other, is there a way to create fixed ID string for RPI server for example "1000" or something which would always be the same so that i can hardcode it to existing call function, so each time they start call it only goes toward RPI and nothing else

A BUG in RTCPReport statistics

I am checking this demo https://xxxx/demos/demo_statistics.html and try to get statistics per second as the code intended to do, however, when I open 2 tabs in the browser and click 'connect' , it fails to collect the data and console like this:

easyrtc.js:4882 Uncaught (in promise) TypeError: stats.result is not a function
at easyrtc.js:4882:35

I check the source code and find out that the stats is the instance of RTCPReport and has some attributes and methods, but result() function is not one of them. The size of it may vary by time, but the specific content can not be acquired in the demo. And if I invoke stats.entries(), it is an empty Iterator.

Would you please help me fix this? Thanks a lot!

Open-EasyRTC logo

We need a logo for Open-EasyRTC, I sucks at design :)
The logo and the color scheme will be used on the new Documentation see #33

Here is 2 logo I'm willing to purchase for a budget of $50, please vote bellow for the logo you prefer.

1j+ojlxKOMkX9WyteRe4hGfWzqPesWIe21evs019NjJE41M1xC0uj
2.
1j+ojl1FOMkX9WypfBe43D6kifaDqRdLmBvIwXs1M3EMoAJtlSgrhvNt8

If anyone want to help I'm willing to pay for the logo the budget above.

docker-compose.yml install error on npm install

Hi everyone.

I have tried to install the server example with docker compose and got an error

npm notice
npm notice New minor version of npm available! 7.0.15 -> 7.1.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.1.2>
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code EISDIR
npm ERR! syscall copyfile
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, copyfile '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'

Thanks and Greetings

How to use open-easyrtc in a Vuejs or Quasar project?

I've made a npm install --save open-easyrtc on my project.

On a Vuejs page I have

import easyrtc from "open-easyrtc"; export default { mounted() { var selfEasyrtcid = ""; connect(); function connect() { easyrtc.setVideoDims(640, 480); easyrtc.setRoomOccupantListener(convertListToButtons); easyrtc.setSocketUrl("//localhost:8443"); . . .

And got the following error:

open_easyrtc__WEBPACK_IMPORTED_MODULE_0___default.a.setVideoDims is not a function"

What am I missing?

Update urls and documentation

You have forked easyrtc into open-easyrtc (which is great as it would be a shame to let this library die off), but a lot of stuff still refers to easyrtc, such as the server example which suggets doing require('easyrtc') or the updateCheckEnable option which makes a version check on "http://easyrtc.com/version/?app=easyrtc" (which btw is a 404).
I'm sure there are other places that need fixing.

Changing between front and rear cameras without disconnecting and connecting?

Hey people, I am working on a app where I need to change cameras whenever I want and the recording shouldn't be effected by it.

This is the code I'm using to change between cameras;

if (currentCameraState == 'front') {
		easyrtc.getVideoSourceList(function (list) {
			var i;
			for (i = 0; i < list.length; i++) {
				if (list[i].label.indexOf('back') > 0) {
					easyrtc.setVideoSource(list[i].id);
					easyrtc.initMediaSource(function () {
						var selfVideo = document.getElementById('selfVideo');
						easyrtc.setVideoObjectSrc(selfVideo, easyrtc.getLocalStream());
						currentCameraState = 'back';
						performCall(theirID);
					}, connectFailure);
					break;
				}
			}
		});
	} else {
		easyrtc.getVideoSourceList(function (list) {
			var i;
			for (i = 0; i < list.length; i++) {
				if (list[i].label.indexOf('front') > 0) {
					easyrtc.setVideoSource(list[i].id);
					easyrtc.initMediaSource(function () {
						var selfVideo = document.getElementById('selfVideo');
						easyrtc.setVideoObjectSrc(selfVideo, easyrtc.getLocalStream());
						currentCameraState = 'front';
						performCall(theirID);
					}, connectFailure);
					break;
				}
			}
		});
	}

PerformCall function is this one (where I need to hangup the call in order to call with the changed camera source);

function performCall(othereasyrtcid) {
	easyrtc.hangupAll();
	if (theirID == '') {
		theirID = othereasyrtcid;
	}
	var acceptedCB = function (accepted, caller) {
		if (!accepted) {
			easyrtc.showError('CALL-REJECTED', 'Sorry, your call to ' + easyrtc.idToName(caller) + ' was rejected');
		}
	};
	var successCB = function () {};
	var failureCB = function () {};
	easyrtc.call(othereasyrtcid, successCB, failureCB, acceptedCB);
}

Bad Ice Candidate When Not Connected to the Same Wifi

I have deployed my app on heroku and it launches without a problem. And works perfectly when I use my computer and phone to do a call when they're both connected to the same wifi. But when I disconnect from wifi on my phone and turn on data, it suddenly gives the error;

doAnswerBody setRemoteDescription failed: InvalidStateError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote offer sdp: Called in wrong state: kHaveLocalOffer

It doesn't work on demos either so I believe this is a problem with either easyrtc framework or the heroku itself.

Note: This problem doesn't happen when the app is launched on localhost.

iOS Devices

Hey, I've been getting "Your browser doesn't support webrtc" error on chrome on ios devices. I've read stuff on internet about apple devices' not supporting webrtc, is it true? It can't be since I tried on a mac before and it worked without problem(safari) but whenever I try to use my application on iphone 6s, chrome says its not supported and safari only sends black screen. I'm not sure what I need to do on this point. Apple device support is fatal :/

I'm getting the error on iPhone 6S. How can I solve this?

FYI: audio/video capture only works if you on https *or* using localhost.

@gfreccia FYI: audio/video capture only works if you on https or using localhost. If you're trying the demo server on an address other than localhost and you haven't enabled SSL, then it won't work and will report that WebRTC isn't supported.
Note: actually, WebRTC is still supported, you could still connect and receive streams from others, you just can't capture from your own audio/video, so you wouldn't be able to send a stream to the others, but receiving would work fine, so the message is a slightly misleading.

Originally posted by @kakaroto in #19 (comment)

onaddstream is deprecated

Getting this error in FF:

onaddstream is deprecated! Use peerConnection.ontrack instead. open-easyrtc.js:9435

How to setup easyrtc server with nginx?

I am trying to deploy my easyrtc server with Nginx.

This is my Nginx config


#user  nobody;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	        proxy_read_timeout 300s;
    	        proxy_connect_timeout 75s;
                proxy_pass http://127.0.0.1:8080;
	        proxy_http_version 1.1;
	        proxy_set_header Upgrade $http_upgrade;
	        proxy_set_header Connection "upgrade";
	        proxy_set_header Host $host;
        }
	
	location /socket.io/ {
 	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_read_timeout 300s;
            proxy_connect_timeout 75s;
            proxy_pass http://127.0.0.1:8080;       
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    include servers/*;
}

Whenever our android or ios client tries to connect with our server. Nginx sending them 502 error and I am also attaching the logs for this

2021/02/12 12:31:43 [error] 64603#0: *47 upstream prematurely closed connection while reading response header from upstream, client: 192.168.20.141, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.20.105"
2021/02/12 12:31:44 [error] 64603#0: *49 upstream prematurely closed connection while reading response header from upstream, client: 192.168.20.141, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.20.105"
2021/02/12 12:31:45 [error] 64603#0: *51 upstream prematurely closed connection while reading response header from upstream, client: 192.168.20.141, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.20.105"
2021/02/12 12:31:47 [error] 64603#0: *53 upstream prematurely closed connection while reading response header from upstream, client: 192.168.20.141, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.20.105"
2021/02/12 12:31:48 [error] 64603#0: *55 upstream prematurely closed connection while reading response header from upstream, client: 192.168.20.141, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.20.105"

I am assuming our node server is not responding to the stream. Can anyone check this and help me out to solve this error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.