Code Monkey home page Code Monkey logo

jquery.peer's Introduction

jquery.peer

Peer-to-peer video chats built on top of WebRTC, with an easy-to-use jQuery interface.

Support for data calls forthcoming!

Usage

This library requires that you also include PeerJS ^0.3.7.

  <!-- Include the scripts in your HTML -->
  <script type="text/javascript" src="http://cdn.peerjs.com/0.3.7/peer.min.js"></script>
  <script type="text/javascript" src="jquery.peer.js"></script>
// Instantiate your videochat element:
$(#my-videochat-element’).peer([options]);

Options:

options is an optional hash of the following:

  • id: If unspecified, will be automatically generated for you.
  • room
  • hideAllControls: Hide the “End call” and “Room list” elements that are automatically placed in your peer element. If you hide these controls, you’ll need to make calls manually.
  • timeout: milliseconds to wait before giving up on a call/connection.

Advanced options:

  • manualCalls: When a call comes in, you can choose whether or not to accept it if manualCalls is enabled.
  • hideOwnVideo: Hide your own video from the display.
  • chatroulette: If true, existing call will end automatically when someone else calls.
  • endCallText: Custom text for the “End call” display.
  • answerCallText: Custom text for the “Answer call” display. This display is only shown if manualCalls is enabled.

Making calls manually:

// Instantiate your videochat element and call a peer (`id`) in your room manually:
$(#my-videochat-element’).peer([options]).peer(‘call’, id);

call is just one of many available methods.


Other available methods:

  • call
  • endCall
  • answerCall
  • connect (WIP)
  • endConnection (WIP)

Events

  • peer.data
  • peer.call

jquery.peer's People

Contributors

michelle avatar michelle-stripe avatar

Watchers

James Cloos avatar Joe Young 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.