Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elcuervo/anchorman
Experimental WebRTC abstraction
https://github.com/elcuervo/anchorman
Last synced: about 1 month ago
JSON representation
Experimental WebRTC abstraction
- Host: GitHub
- URL: https://github.com/elcuervo/anchorman
- Owner: elcuervo
- Created: 2013-05-13T09:18:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-13T09:20:34.000Z (over 11 years ago)
- Last Synced: 2024-11-28T23:28:11.880Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anchorman
![](http://www.anchorman-quotes.info/wp-content/uploads/2010/10/Contact-us-anchorman-quotes.jpg)
Dead simple p2p
**PROOF OF CONCEPT, tested in Chrome Canary. More compatibility soon**
## Why is this different from [p2p lib out there]?
Conceptual differences basically.
The transport method (or signaling technique) should be irrelevante IMHO, that's
why there are no hardcoded communication methods. You can overwrite the signals
names if you want to.## Basic usage
```javascript
var anchorman = new Anchorman("[Choose your schema]");
```Choose your action:
### Screen sharing
```javascript
// This will try to share the screen based on Chrome screenshare functionality.
// Currently behind `chrome://flags`
anchorman.screen.share();
```### Camera access
```javascript
// Start the camera without do anything.
anchorman.camera.broadcast();// Or use the stream as you wish
anchorman.camera.broadcast(function(stream) {
// Have fun with the stream
});// Handle a incomming stream
anchorman.camera.receive(function(stream) {
// Handle incomming
});
```### Data transfer
```javascript
// Creates a channel or access an already initialized channel
// Returns an actual RTC Channel
var channel = anchorman.channels("chat");// Accept the message callback
channel.onmessage = function(event) {};// Initialize the candidate handshake for a given channel
anchorman.data();// Send a given message
channel.send("bla");
```