RTCall.js — A library for Browser-to-Browser audio-only calling
Now, RTCMultiConnection-v1.4 and upper releases supports admin/guest features; so RTCMultiConnection.js
is preferred.
Why RTCall.js?
- In your own site; as an admin; you may want to be auto-alerted for each new visitor i.e. customer.
- You may want to make voice-only calls between admin and customers
The entire process is browser to browser.
=
<script src="https://www.webrtc-experiment.com/RTCall.js"></script>
=
Remember: All lines are optional!
call = new RTCall();
=
onincomingcall
fires each time if someone calls you:
call.onincomingcall = function(caller) {
call.receive(caller.receiverid);
};
=
oncustomer
is fired only for admin
:
call.oncustomer = function(customer) {
call.call(customer.callerid);
};
=
onstream
returns remote media stream:
call.onstream = function(e) {
// e.stream ---- remote media stream object
// e.callerid ---- id of the remote person
audio = e.audio;
audio.play(); // "e.audio" object is paused by default
document.documentElement.appendChild(audio);
};
=
initializing RTCall
object:
call.init();
=
Admin can call customers using their caller-ids. Remeber, customers caller-ids are always passed over oncustomer
method:
call.oncustomer = function(customer) {
call.call(customer.callerid);
};
Customers can call the admin too; using admin's caller-id
:
call.call('admin-caller-id');
=
receiver-id
is always passed over onincomingcall
:
call.onincomingcall = function(caller) {
call.receive(caller.receiverid);
};
=
By default: admin
is false
:
call.admin = true;
=
=
RTCall.js supports following browsers:
Browser | Support |
---|---|
Firefox | Stable / Aurora / Nightly |
Google Chrome | Stable / Canary / Beta / Dev |
Android | Chrome Beta |
=
RTCall.js is released under MIT licence . Copyright (c) 2013 Muaz Khan.