forked from muaz-khan/WebRTC-Experiment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebRTC-Scalable-Broadcast and Firefox-Extensions added.
1. https://github.com/muaz-khan/WebRTC-Scalable-Broadcast 2. https://github.com/muaz-khan/Firefox-Extensions
- Loading branch information
Showing
21 changed files
with
6,681 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# [Firefox Extensions](https://github.com/muaz-khan/Firefox-Extensions) | ||
|
||
Enable screen capturing in Firefox (for https://www.webrtc-experiment.com demos only): | ||
|
||
* [enable-screen-capturing.xpi](https://www.webrtc-experiment.com/store/firefox-extension/enable-screen-capturing.xpi) | ||
|
||
## Credits | ||
|
||
[Muaz Khan](https://github.com/muaz-khan): | ||
|
||
1. Personal Webpage: http://www.muazkhan.com | ||
2. Email: [email protected] | ||
3. Twitter: https://twitter.com/muazkh and https://twitter.com/WebRTCWeb | ||
4. Google+: https://plus.google.com/+WebRTC-Experiment | ||
|
||
## License | ||
|
||
[Firefox-Extensions](https://github.com/muaz-khan/Firefox-Extensions) are released under [MIT licence](https://www.webrtc-experiment.com/licence/) . Copyright (c) [Muaz Khan](https://plus.google.com/+MuazKhan). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Enable Screen Capturing using [Firefox Extensions API](https://github.com/muaz-khan/Firefox-Extensions) | ||
|
||
Enable screen capturing using Firefox (for https://www.webrtc-experiment.com demos only): | ||
|
||
* [enable-screen-capturing.xpi](https://www.webrtc-experiment.com/store/firefox-extension/enable-screen-capturing.xpi) | ||
|
||
To use in your own domains: | ||
|
||
Modify `bootstrap.js` file, line 18: | ||
|
||
```javascript | ||
['yourDomain.com', 'www.yourDomain.com'].forEach(function(domain) { | ||
if (values.indexOf(domain) === -1) { | ||
values.push(domain); | ||
addon_domains.push(domain); | ||
} | ||
}); | ||
``` | ||
|
||
And modify `install.rdf` for you extension information (name, URL, icon etc.) | ||
|
||
## Credits | ||
|
||
[Muaz Khan](https://github.com/muaz-khan): | ||
|
||
1. Personal Webpage: http://www.muazkhan.com | ||
2. Email: [email protected] | ||
3. Twitter: https://twitter.com/muazkh and https://twitter.com/WebRTCWeb | ||
4. Google+: https://plus.google.com/+WebRTC-Experiment | ||
|
||
## License | ||
|
||
[Firefox-Extensions](https://github.com/muaz-khan/Firefox-Extensions) are released under [MIT licence](https://www.webrtc-experiment.com/licence/) . Copyright (c) [Muaz Khan](https://plus.google.com/+MuazKhan). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* taken from: HenrikJoreteg/getScreenMedia/firefox-extension-sample | ||
* original source: https://hg.mozilla.org/users/blassey_mozilla.com/screenshare-whitelist/ | ||
*/ | ||
var addon_domains = []; // list of domains the addon added | ||
var allowed_domains_pref = 'media.getusermedia.screensharing.allowed_domains'; | ||
var enable_screensharing_pref = 'media.getusermedia.screensharing.enabled'; | ||
|
||
function startup(data, reason) { | ||
if (reason === APP_STARTUP) { | ||
return; | ||
} | ||
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); | ||
var values = prefs.getCharPref(allowed_domains_pref).split(','); | ||
|
||
['webrtc-experiment.com', 'www.webrtc-experiment.com'].forEach(function(domain) { | ||
if (values.indexOf(domain) === -1) { | ||
values.push(domain); | ||
addon_domains.push(domain); | ||
} | ||
}); | ||
|
||
if(prefs.getBoolPref(enable_screensharing_pref) == false) { | ||
prefs.setBoolPref(enable_screensharing_pref, 1); | ||
} | ||
prefs.setCharPref(allowed_domains_pref, values.join(',')); | ||
} | ||
|
||
function shutdown(data, reason) { | ||
if (reason === APP_SHUTDOWN) { | ||
return; | ||
} | ||
var prefs = Components.classes["@mozilla.org/preferences-service;1"] | ||
.getService(Components.interfaces.nsIPrefBranch); | ||
var values = prefs.getCharPref(allowed_domains_pref).split(','); | ||
values = values.filter(function(value) { | ||
return addon_domains.indexOf(value) === -1; | ||
}); | ||
prefs.setCharPref(allowed_domains_pref, values.join(',')); | ||
} | ||
|
||
function install(data, reason) {} | ||
|
||
function uninstall(data, reason) {} |
Binary file added
BIN
+2.22 KB
Firefox-Extensions/enable-screen-capturing/enable-screen-capturing.xpi
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> | ||
<Description about="urn:mozilla:install-manifest"> | ||
<em:id>[email protected]</em:id> | ||
<em:type>2</em:type> | ||
<em:name>Screen Capturing in Firefox</em:name> | ||
<em:description>Firefox extension to enable screen capturing</em:description> | ||
<em:version>1.0</em:version> | ||
<em:bootstrap>true</em:bootstrap> | ||
<em:creator>Muaz Khan</em:creator> | ||
<em:homepageURL>https://www.webrtc-experiment.com/</em:homepageURL> | ||
<em:iconURL>icon.png</em:iconURL> | ||
<em:targetApplication> | ||
<Description> | ||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> | ||
<em:minVersion>33.0</em:minVersion> | ||
<em:maxVersion>36.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
</Description> | ||
</RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# [WebRTC Scalable Broadcast](https://github.com/muaz-khan/WebRTC-Scalable-Broadcast) | ||
|
||
Scalable WebRTC peer-to-peer broadcasting demo. | ||
|
||
[](https://npmjs.org/package/webrtc-scalable-broadcast) [](https://npmjs.org/package/webrtc-scalable-broadcast) | ||
|
||
This module simply initializes socket.io and configures it in a way that single broadcast can be relayed over unlimited users without any bandwidth/CPU usage issues. Everything happens peer-to-peer! | ||
|
||
``` | ||
npm install webrtc-scalable-broadcast | ||
node .\node_modules\webrtc-scalable-broadcast\server.js | ||
``` | ||
|
||
And now open: `http://localhost:8888`. | ||
|
||
## How it works? | ||
|
||
This demo runs top over [RTCMultiConnection.js](http://www.RTCMultiConnection.org/). Though, you can use it in any other [WebRTC Experiment](https://www.webrtc-experiment.com/). | ||
|
||
It following technique mentioned here: | ||
|
||
* https://github.com/muaz-khan/WebRTC-Experiment/issues/2 | ||
|
||
 | ||
|
||
Assuming peers 1-to-10: | ||
|
||
### First Peer: | ||
|
||
Peer1 is the only peer that invokes `getUserMedia`. Rest of the peers will simply [forward/relay remote stream](https://www.webrtc-experiment.com/RTCMultiConnection/remote-stream-forwarding.html). | ||
|
||
``` | ||
peer1 captures user-media | ||
peer1 starts the room | ||
``` | ||
|
||
### Second Peer: | ||
|
||
``` | ||
peer2 joins the room | ||
peer2 gets remote stream from peer1 | ||
peer2 opens a "parallel" broadcasting peer named as "peer2-broadcaster" | ||
``` | ||
|
||
### Third Peer: | ||
|
||
``` | ||
peer3 joins the room | ||
peer3 gets remote stream from peer2 | ||
peer3 opens a "parallel" broadcasting peer named as "peer3-broadcaster" | ||
``` | ||
|
||
### Fourth Peer: | ||
|
||
``` | ||
peer4 joins the room | ||
peer4 gets remote stream from peer3 | ||
peer4 opens a "parallel" broadcasting peer named as "peer4-broadcaster" | ||
``` | ||
|
||
### Fifth Peer: | ||
|
||
``` | ||
peer5 joins the room | ||
peer5 gets remote stream from peer4 | ||
peer5 opens a "parallel" broadcasting peer named as "peer5-broadcaster" | ||
``` | ||
|
||
and 10th peer: | ||
|
||
``` | ||
peer10 joins the room | ||
peer10 gets remote stream from peer9 | ||
peer10 opens a "parallel" broadcasting peer named as "peer10-broadcaster" | ||
``` | ||
|
||
## Conclusion | ||
|
||
1. Peer9 gets remote stream from peer8 | ||
2. Peer15 gets remote stream from peer14 | ||
3. Peer50 gets remote stream from peer49 | ||
|
||
and so on. | ||
|
||
## Limitation | ||
|
||
This demo works only with screen and video-only streams. It doesn't works with audio. | ||
|
||
Because currently [remote audio processing](https://www.webrtc-experiment.com/demos/remote-stream-recording.html) or forwarding isn't supported in chrome. | ||
|
||
This demo works only in Chrome; no Firefox support yet. Because Firefox isn't supporting non-APM sources for peer-streaming. | ||
|
||
## License | ||
|
||
[Scalable WebRTC Broadcasting Demo](https://github.com/muaz-khan/WebRTC-Scalable-Broadcast) is released under [MIT licence](https://www.webrtc-experiment.com/licence/) . Copyright (c) [Muaz Khan](https://plus.google.com/+MuazKhan). |
Oops, something went wrong.