Giter Club home page Giter Club logo

simplewebrtc's Introduction

SimpleWebRTC - World's easiest WebRTC lib

Gitter

Want to see it in action? 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-v2.js"></script> 
        <style>
            #remoteVideos video {
                height: 150px;
            }
            #localVideo {
                height: 150px;
            }
        </style>
    </head>
    <body>
        <video id="localVideo"></video>
        <div id="remoteVideos"></div>
    </body>
</html>

2. 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
});

3. 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. By default, SimpleWebRTC uses Google's public STUN server (stun.l.google.com:19302), which is intended for public use according to: https://twitter.com/HenrikJoreteg/status/354105684591251456

Note that you will most likely also need to run your own TURN servers. See http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ for a basic tutorial.

Filetransfer

Sending files between individual participants is supported. See http://simplewebrtc.com/filetransfer.html for a demo.

Note that this is not file sharing between a group which requires a completly different approach.

It's not always that simple...

Sometimes you need to do more advanced stuff. See http://simplewebrtc.com/notsosimple.html for some examples.

Got questions?

Join the SimpleWebRTC discussion list:

http://lists.andyet.com/mailman/listinfo/simplewebrtc

or the Gitter channel:

https://gitter.im/HenrikJoreteg/SimpleWebRTC

API

simplewebrtc's People

Contributors

aral avatar davidbanham avatar fippo avatar gitter-badger avatar henrikjoreteg avatar ike avatar johnmclear avatar manubo avatar owenthereal avatar paulhovey avatar pdehaan avatar sockdrawermoney avatar stpeter avatar xdumaine avatar xenyou avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.