diff --git a/README.md b/README.md index 89c139c6..19135ef7 100755 --- a/README.md +++ b/README.md @@ -12,8 +12,16 @@ ```sh mkdir demo && cd demo + +# install from NPM +npm install rtcmulticonnection + +# or clone from github git clone https://github.com/muaz-khan/RTCMultiConnection.git ./ -npm install --production + +# install all required packages +# you can optionally include --save-dev +npm install node server --port=9001 ``` @@ -31,6 +39,7 @@ connection.socketURL = 'https://webrtcweb.com:9001/'; ```sh npm install rtcmulticonnection-server +node server --port=9001 ``` For more info, please check: @@ -58,12 +67,14 @@ For more info, please check: ## iOS+Android Demo Apps * https://github.com/muaz-khan/cordova-mobile-apps +* https://webrtcweb.com/cordova-apps/ > Note: RTCMultiConnection supports Safari-11 and Edge. ## Wiki Pages * https://github.com/muaz-khan/RTCMultiConnection/wiki +* https://github.com/muaz-khan/RTCMultiConnection-Server/wiki ## License diff --git a/bower.json b/bower.json index 1c02ee1a..957231c8 100755 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "rtcmulticonnection", "description": "RTCMultiConnection is a WebRTC JavaScript wrapper library runs top over RTCPeerConnection API to provide multi-session establishment scenarios.", - "version": "3.5.9", + "version": "3.6.1", "authors": [ { "name": "Muaz Khan", diff --git a/dev/MultiPeersHandler.js b/dev/MultiPeersHandler.js index 64391066..87033de1 100755 --- a/dev/MultiPeersHandler.js +++ b/dev/MultiPeersHandler.js @@ -41,8 +41,12 @@ function MultiPeers(connection) { if (!isNull(data.size) && !isNull(data.type)) { if (connection.enableFileSharing) { self.shareFile(data, remoteUserId); + return; + } + + if (typeof data !== 'string') { + data = JSON.stringify(data); } - return; } if (data.type !== 'text' && !(data instanceof ArrayBuffer) && !(data instanceof DataView)) { diff --git a/docs/README.md b/docs/README.md index 6339f352..ee7842db 100755 --- a/docs/README.md +++ b/docs/README.md @@ -30,10 +30,7 @@ # iOS+Android Demo Apps * http://webrtcweb.com/cordova-apps/ - -## Twitter - -* https://twitter.com/WebRTCWeb i.e. @WebRTCWeb +* https://github.com/muaz-khan/cordova-mobile-apps ## License diff --git a/docs/getting-started.md b/docs/getting-started.md index f365a3cb..9ddc8c43 100755 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -113,10 +113,6 @@ You can use `jsfiddle.net` for testing purpose. 6. [How to write iOS/Android applications?](https://github.com/muaz-khan/RTCMultiConnection/tree/master/docs/ios-android.md) 7. [Tips & Tricks](https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/tips-tricks.md) -## Twitter - -* https://twitter.com/WebRTCWeb i.e. @WebRTCWeb - ## License [RTCMultiConnection](https://github.com/muaz-khan/RTCMultiConnection) is released under [MIT licence](https://github.com/muaz-khan/RTCMultiConnection/blob/master/LICENSE.md) . Copyright (c) [Muaz Khan](http://www.MuazKhan.com/). diff --git a/docs/how-to-use.md b/docs/how-to-use.md index 19e58ef6..de966d44 100755 --- a/docs/how-to-use.md +++ b/docs/how-to-use.md @@ -4,8 +4,6 @@ * [Getting Started guide for RTCMultiConnection](https://github.com/muaz-khan/RTCMultiConnection/tree/master/docs/getting-started.md) -All files from `/dist` directory are available on CDN: `https://cdn.webrtc-experiment.com:443/` - ```html @@ -87,32 +85,7 @@ Here is a demo explaining how to use above `socketURL`: ## Integrate in your own applications? -> Note: this section works only with v3.4.6 or earlier releases. - -```javascript -// node.js code -require('./Signaling-Server.js')(httpServerHandlerOrPort); -``` - -If you're using [express.js](http://stackoverflow.com/a/35985109/552182): - -```javascript -var fs = require('fs'); - -var options = { - key: fs.readFileSync('fake-keys/privatekey.pem'), - cert: fs.readFileSync('fake-keys/certificate.pem') -}; - -var express = require("express"), - http = require("https"), // Use HTTPs here ------------- - app = express(), - server = http.createServer(options, app); - -server.listen(3000); - -require('./Signaling-Server.js')(server); -``` +* https://github.com/muaz-khan/RTCMultiConnection-Server/wiki/Integrate-inside-nodejs-applications # Other Documents @@ -123,10 +96,6 @@ require('./Signaling-Server.js')(server); 5. [How to write iOS/Android applications?](https://github.com/muaz-khan/RTCMultiConnection/tree/master/docs/ios-android.md) 6. [Tips & Tricks](https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/tips-tricks.md) -## Twitter - -* https://twitter.com/WebRTCWeb i.e. @WebRTCWeb - ## License [RTCMultiConnection](https://github.com/muaz-khan/RTCMultiConnection) is released under [MIT licence](https://github.com/muaz-khan/RTCMultiConnection/blob/master/LICENSE.md) . Copyright (c) [Muaz Khan](http://www.MuazKhan.com/). diff --git a/docs/installation-guide.md b/docs/installation-guide.md index 9615a3c7..d66d5a76 100755 --- a/docs/installation-guide.md +++ b/docs/installation-guide.md @@ -10,7 +10,7 @@ ```sh git clone https://github.com/muaz-khan/RTCMultiConnection.git ./ -npm install --production +npm install ``` Or download ZIP: @@ -20,15 +20,14 @@ wget https://github.com/muaz-khan/RTCMultiConnection/archive/master.zip unzip master.zip ``` -Then call `npm install --production`. +Then call `npm install`. -Use `--production` to skip `grunt` dependencies. You don't need `grunt` until you modify library itself. # Install using NPM or Bower ```sh -npm install rtcmulticonnection --production +npm install rtcmulticonnection # or bower install rtcmulticonnection @@ -37,6 +36,10 @@ bower install rtcmulticonnection # Run `server.js` ```sh +# install all required packages first +npm install + +# then run the server node server.js ``` @@ -44,7 +47,7 @@ Now open `http://localhost:9001/`. # Modify config.json -* https://github.com/muaz-khan/RTCMultiConnection/blob/master/config.json +* https://github.com/muaz-khan/RTCMultiConnection-Server/wiki/config.json ```json { diff --git a/docs/ios-android.md b/docs/ios-android.md index 81989d6d..a0a4998a 100755 --- a/docs/ios-android.md +++ b/docs/ios-android.md @@ -4,6 +4,10 @@ > > So you do not need to build a cordova or ionic application. +Here is list of all cordova/iosnic demos: + +* https://github.com/muaz-khan/cordova-mobile-apps + Please check these docs as well: * [Write iOS apps using RTCMultiConnection](http://www.rtcmulticonnection.org/docs/Write-iOS-Apps/) @@ -101,8 +105,8 @@ cordova platform remove ios cordova platform remove android # add latest platform versions -cordova platform add ios -cordova platform add android +cordova platform add android@6.3.0 +cordova platform add ios@4.4.0 ``` # Build your Apps diff --git a/docs/tips-tricks.md b/docs/tips-tricks.md index 6020b124..d21c7d3e 100755 --- a/docs/tips-tricks.md +++ b/docs/tips-tricks.md @@ -4,7 +4,7 @@ ## How to secure your socket.io usage? -Modify [`Signaling-Server.js`](https://github.com/muaz-khan/RTCMultiConnection/blob/master/Signaling-Server.js) and add this line: +Modify [`Signaling-Server.js`](https://github.com/muaz-khan/RTCMultiConnection-Server/blob/master/node_scripts/Signaling-Server.js) and add this line: ```javascript io.on('connection', onConnection); @@ -36,7 +36,7 @@ Now you've restricted the usage of socket.io only on domain `https://domain.com: ## How to arrange videos? -It happens all insidde the [`onstream`](http://www.rtcmulticonnection.org/docs/onstream/) event. +It happens all insidde the [`onstream`](https://www.rtcmulticonnection.org/docs/onstream/) event. ```javascript connection.onstream = function(event) { @@ -380,7 +380,7 @@ v3 users can get list of existing public-rooms using this API (`connection.getPu * https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/api.md#getpublicmoderators -However v2 users can use `connection.onNewSession` event: http://www.rtcmulticonnection.org/docs/onNewSession/ +However v2 users can use `connection.onNewSession` event: https://www.rtcmulticonnection.org/docs/onNewSession/ # Other Documents @@ -392,10 +392,6 @@ However v2 users can use `connection.onNewSession` event: http://www.rtcmulticon 6. [How to write iOS/Android applications?](https://github.com/muaz-khan/RTCMultiConnection/tree/master/docs/ios-android.md) 7. [Tips & Tricks](https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/tips-tricks.md) -## Twitter - -* https://twitter.com/WebRTCWeb i.e. @WebRTCWeb - ## License [RTCMultiConnection](https://github.com/muaz-khan/RTCMultiConnection) is released under [MIT licence](https://github.com/muaz-khan/RTCMultiConnection/blob/master/LICENSE.md) . Copyright (c) [Muaz Khan](http://www.MuazKhan.com/). diff --git a/docs/upgrade.md b/docs/upgrade.md index 128d3ebc..10c89b6a 100755 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -1,6 +1,6 @@ # Upgrade -> This page explains how to upgrade to latest version (v3). +> This page explains how to upgrade to latest version (v3 or higher). Use `streamEvents` instead of `connection.streams`: diff --git a/package.json b/package.json index 3edb9f1b..a9875fae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rtcmulticonnection", "preferGlobal": false, - "version": "3.5.9", + "version": "3.6.1", "author": { "name": "Muaz Khan", "email": "muazkh@gmail.com", @@ -13,7 +13,9 @@ "url": "https://github.com/muaz-khan/RTCMultiConnection.git" }, "scripts": { - "start": "node server.js" + "start": "node server.js", + "heroku-prebuild": "export NPM_CONFIG_PRODUCTION=false; export NODE_ENV=; NPM_CONFIG_PRODUCTION=false NODE_ENV=development npm install --only=dev --dev", + "heroku-postbuild": "export NPM_CONFIG_PRODUCTION=true; export NODE_ENV=production;" }, "engines": { "node": "latest" @@ -42,18 +44,7 @@ "muaz", "muaz-khan" ], - "dependencies": { - "rtcmulticonnection-server": "latest", - "detectrtc": "latest", - "recordrtc": "latest", - "getstats": "latest", - "fbr": "latest", - "webrtc-screen-capturing": "latest", - "socket.io": "latest", - "webrtc-adapter": "latest", - "canvas-designer": "latest", - "multistreamsmixer": "latest" - }, + "dependencies": {}, "analyze": false, "license": "MIT", "readmeFilename": "README.md", @@ -65,6 +56,16 @@ "tonicExampleFilename": "npm-test.js", "_from": "rtcmulticonnection@", "devDependencies": { + "rtcmulticonnection-server": "latest", + "detectrtc": "latest", + "recordrtc": "latest", + "getstats": "latest", + "fbr": "latest", + "webrtc-screen-capturing": "latest", + "socket.io": "latest", + "webrtc-adapter": "latest", + "canvas-designer": "latest", + "multistreamsmixer": "latest", "grunt": "0.4.5", "grunt-bump": "0.7.0", "grunt-cli": "0.1.13",