Skip to content

Commit

Permalink
RTCMultiConnection-v3.0, Chrome-Extensions, Firefox-Extensions, Ffmpe…
Browse files Browse the repository at this point in the history
…g-asm.js, DataChannel.js, RecordRTC.js, Conversation.js, etc. updated.

+MediaStreamRecorder.js
  • Loading branch information
muaz-khan committed Apr 1, 2015
1 parent b5bea35 commit ce0b071
Show file tree
Hide file tree
Showing 89 changed files with 8,581 additions and 564 deletions.
33 changes: 19 additions & 14 deletions Chrome-Extensions/desktopCapture-p2p/desktop-capturing.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,29 +200,35 @@ function contextMenuSuccessCallback() {

// using websockets for signaling

var webSocketURI = 'wss://wsnodejs.nodejitsu.com:443';
// var webSocketURI = 'ws://localhost:8888';

function openSignalingChannel(config) {
config.channel = config.channel || this.channel;
var websocket = new WebSocket(webSocketURI);

var pub = 'pub-c-3c0fc243-9892-4858-aa38-1445e58b4ecb';
var sub = 'sub-c-d0c386c6-7263-11e2-8b02-12313f022c90';

WebSocket = PUBNUB.ws;

var websocket = new WebSocket('wss://pubsub.pubnub.com/' + pub + '/' + sub + '/' + config.channel);

websocket.channel = config.channel;

websocket.onopen = function() {
websocket.push(JSON.stringify({
open: true,
channel: config.channel
}));
if (config.callback) config.callback(websocket);
if (config.callback) {
config.callback(websocket);
}
};

websocket.onerror = function() {
setDefaults();
chrome.windows.create({
url: "data:text/html,<h1>Unable to connect to " + webSocketURI + "</h1>",
url: "data:text/html,<h1>Unable to connect to pubsub.pubnub.com.</h1>",
type: 'popup',
width: screen.width / 2,
height: 170
});
chrome.runtime.reload();
};

websocket.onclose = function() {
setDefaults();
chrome.windows.create({
Expand All @@ -233,15 +239,14 @@ function contextMenuSuccessCallback() {
});
chrome.runtime.reload();
};

websocket.onmessage = function(event) {
config.onmessage(JSON.parse(event.data));
};

websocket.push = websocket.send;
websocket.send = function(data) {
websocket.push(JSON.stringify({
data: data,
channel: config.channel
}));
websocket.push(JSON.stringify(data));
};
}

Expand Down
4 changes: 2 additions & 2 deletions Chrome-Extensions/desktopCapture-p2p/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name" : "WebRTC Desktop Sharing",
"author": "Muaz Khan",
"version" : "1.5",
"version" : "1.6",
"manifest_version" : 2,
"minimum_chrome_version": "34",
"description" : "Share screen of any application or entire screen or screen of any chrome tab. It is private, full-HD screen sharing.",
"homepage_url": "https://www.webrtc-experiment.com/",
"background": {
"scripts": ["RTCMultiConnection-v2.1.9.js", "desktop-capturing.js"],
"scripts": ["websocket.js", "RTCMultiConnection-v2.1.9.js", "desktop-capturing.js"],
"persistent": false
},
"browser_action" : {
Expand Down
65 changes: 37 additions & 28 deletions Chrome-Extensions/desktopCapture-p2p/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<script src="https://cdn.webrtc-experiment.com/RTCMultiConnection-v2.1.9.js"> </script>
<script src="https://cdn.webrtc-experiment.com/view/websocket.js"> </script>

<style>
body,
Expand Down Expand Up @@ -146,33 +147,6 @@
window.params = params;
})();

// using websockets for signaling
function openSignalingChannel(config) {
config.channel = config.channel || this.channel;
var websocket = new WebSocket('wss://wsnodejs.nodejitsu.com:443');
// var websocket = new WebSocket('ws://localhost:8888');
websocket.onopen = function() {
websocket.push(JSON.stringify({
open: true,
channel: config.channel
}));
if (config.callback) config.callback(websocket);
};
websocket.onerror = function() {
location.reload();
};
websocket.onmessage = function(event) {
config.onmessage(JSON.parse(event.data));
};
websocket.push = websocket.send;
websocket.send = function(data) {
websocket.push(JSON.stringify({
data: data,
channel: config.channel
}));
};
}

function setBandwidth(connection) {
// www.RTCMultiConnection.org/docs/bandwidth/
connection.bandwidth = {
Expand Down Expand Up @@ -270,7 +244,42 @@

// using websockets as signaling medium
// http://www.rtcmulticonnection.org/docs/openSignalingChannel/
connection.openSignalingChannel = openSignalingChannel;
// using websockets for signaling
connection.openSignalingChannel = function(config) {
config.channel = config.channel || this.channel;

var pub = 'pub-c-3c0fc243-9892-4858-aa38-1445e58b4ecb';
var sub = 'sub-c-d0c386c6-7263-11e2-8b02-12313f022c90';

WebSocket = PUBNUB.ws;

var websocket = new WebSocket('wss://pubsub.pubnub.com/' + pub + '/' + sub + '/' + config.channel);

websocket.channel = config.channel;

websocket.onopen = function() {
if (config.callback) {
config.callback(websocket);
}
};

websocket.onerror = function() {
//location.reload();
};

websocket.onclose = function() {
//location.reload();
};

websocket.onmessage = function(event) {
config.onmessage(JSON.parse(event.data));
};

websocket.push = websocket.send;
websocket.send = function(data) {
websocket.push(JSON.stringify(data));
};
}
</script>

<script>
Expand Down
Loading

0 comments on commit ce0b071

Please sign in to comment.