ViewAR Call
This is ViewAR's call service. To use this package you need to have the ViewAR API installed (https://www.npmjs.com/package/viewar-api).
The purpose of this service is to set up a connection between several clients and a server and to handle the communication (call, hang up,...) between them. The events are based on rxjs observables. If to users agree on a call, the called user's camera picture is shared with the caller.
For more information visit our developer portal at developer.viewar.com or our website at www.viewar.com.
Usage
Initialize the call service:
;; await viewarApi;const callClient = await ;
To connect to the given server:
await callClient;
The call service is build around a server which has several sessions (also called rooms). The clients can call each other only if they are within the same session. To join a session use the following code (a new session will be created if not existing):
await callClient
A user can call another user within the same session.
await callClient;callClientacceptedCall; // Wait for user to accept the callawait { callClientacceptedCall;}
A called user needs to accept an incoming call:
callClientincomingCall;
Get a list of all available clients:
callClientclients // The available flag will be automatically set.
You can also subscribe to changes of clients available:
callClientclientsUpdate;
To leave a session:
await callClient;