Simplest WebRTC ever
Switch branches/tags
Nothing to show
Pull request Compare This branch is 268 commits behind andyet:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
fakekeys
scripts
.gitignore
.jshintignore
.jshintrc
LICENSE
README.md
build.js
index.html
latest.js
package.json
server.js
simplewebrtc.bundle.js
simplewebrtc.js
socket.io.js

README.md

SimpleWebRTC - World's easiest WebRTC lib

Check out the demo: https://talky.io

It's so easy:

1. Some basic html

<!DOCTYPE html>
<html>
    <head>
        <script src="http://simplewebrtc.com/latest.js"></script> 
        <style>
            #remoteVideos video {
                height: 150px;
            }
            #localVideo {
                height: 150px;
            }
        </style>
    </head>
    <body>
        <video id="localVideo"></video>
        <div id="remoteVideos"></div>
    </body>
</html>

1. Create our WebRTC object

var webrtc = new SimpleWebRTC({
    // the id/element dom element that will hold "our" video
    localVideoEl: 'localVideo',
    // the id/element dom element that will hold remote videos
    remoteVideosEl: 'remoteVideos',
    // immediately ask for camera access
    autoRequestMedia: true
});

2. Tell it to join a room when ready

// we have to wait until it's ready
webrtc.on('readyToCall', function () {
    // you can name it anything
    webrtc.joinRoom('your awesome room name');
});

Available Options

peerConnectionConfig - Set this to specify your own STUN and TURN servers. SimpleWebRTC uses Google's public STUN server by default: stun.l.google.com:19302. It's intended for public use according to: https://twitter.com/HenrikJoreteg/status/354105684591251456