Skip to content

Commit

Permalink
Fixed & updated "tabCapture" extension
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Nov 9, 2018
1 parent a2e10b6 commit 308d475
Show file tree
Hide file tree
Showing 14 changed files with 633 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ function shareStreamUsingRTCMultiConnection(stream) {
connection.socketURL = 'https://webrtcweb.com:9001/';
connection.autoCloseEntireSession = true;

// this must match the viewer page
connection.socketMessageEvent = 'desktopCapture';

connection.password = null;
if (room_password && room_password.length) {
connection.password = room_password;
}

connection.enableLogs = true;
connection.session = {
audio: true,
Expand Down Expand Up @@ -76,23 +84,6 @@ function shareStreamUsingRTCMultiConnection(stream) {
// www.RTCMultiConnection.org/docs/attachStreams/
connection.attachStreams.push(stream);

if (room_password && room_password.length) {
connection.onRequest = function(request) {
if (request.extra.password !== room_password) {
connection.reject(request);
chrome.windows.create({
url: "data:text/html,<title>Unique Room URL</title><link rel='icon' href='images/desktopCapture128.png'><h1>A user tried to join your room with invalid password. His request is rejected. He tried password: " + request.extra.password + " </h2>",
type: 'popup',
width: screen.width / 2,
height: 170
});
return;
}

connection.accept(request);
};
}

var text = '-';
(function looper() {
if (!connection) {
Expand Down Expand Up @@ -161,11 +152,6 @@ function shareStreamUsingRTCMultiConnection(stream) {
});
}

connection.password = null;
if (room_password && room_password.length) {
connection.password = room_password;
}

connection.open(connection.sessionid, roomOpenCallback);

connection.onleave = connection.onPeerStateChanged = function() {
Expand Down
2 changes: 1 addition & 1 deletion desktopCapture-p2p/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name":"WebRTC Desktop Sharing",
"author":"Muaz Khan",
"version":"5.2",
"version":"5.3",
"manifest_version":2,
"minimum_chrome_version":"34",
"description":"WebRTC P2P HQ/HD screen-sharing. Share camera, microphone, speakers, full-screen, or software's screens.",
Expand Down
4 changes: 4 additions & 0 deletions desktopCapture-p2p/screen-receivers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ function d(s) {
var connection = new RTCMultiConnection(params.s);
// connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';
connection.socketURL = 'https://webrtcweb.com:9001/';
connection.autoCloseEntireSession = true;

// this must match the extension page
connection.socketMessageEvent = 'desktopCapture';

connection.enableLogs = true;
connection.session = {
Expand Down
2 changes: 2 additions & 0 deletions screen-recording/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

## Call From Your Own WebSite

**Live Demo:** [simple-demos/RecordRTC_Extension.html](https://www.webrtc-experiment.com/RecordRTC/simple-demos/RecordRTC_Extension.html)

You can call this chrome extension directly from your own website as well!

```javascript
Expand Down
Loading

0 comments on commit 308d475

Please sign in to comment.