Peer-to-peer video chats built on top of WebRTC, with an easy-to-use jQuery interface.
Support for data calls forthcoming!
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.roomhideAllControls: Hide the “End call” and “Room list” elements that are automatically placed in yourpeerelement. 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 ifmanualCallsis 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 ifmanualCallsis 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:
callendCallanswerCallconnect(WIP)endConnection(WIP)
Events
peer.datapeer.call