Interface | Description |
---|---|
IceServerConfig |
Configuration for ICE Servers.
|
ServiceAuthHandler |
Handle authentication challenge from service.
|
ServiceAuthHandler.Challenge |
Authentication challenge.
|
WSCSession.ConnectionCallback |
Callback for connection notification.
|
Class | Description |
---|---|
HttpContext |
HttpContext is used to pass login information between the
HTTP client and the Websocket client API.
|
HttpContext.Builder |
Builder for the HttpContext class.
|
IceServerConfig.IceServer |
Configuration for an ICE server.
|
Package |
Base class for all packages including Register, Call and others.
|
SubSession |
Base class for all interaction classes such as Call.
|
WSCSession |
WSCSession represents a session between the client and the WebRTC Session Controller server.
|
WSCSession.Builder |
Builder for WSCSession class.
|
WSCSession.Observer |
Observer for session state change.
|
Enum | Description |
---|---|
SessionState |
State of the session.
|
To create a session and listen for session state changes:
String userName = "alice@example.com";
String webSocketURL = "ws://server:port/ws/webrtc/someapp";
HttpContext httpContext = HttpContext.Builder.create()...;
WSCSession.Builder builder = WSCSession.Builder.create(new URI(webSocketURL))
.withConnectionCallback(new MyConnectionHandler())
.withUserName(username)
.withObserver(new MySessionObserver())
.withPackage(new CallPackage())
.withHttpContext(httpContext)
.withIceServerConfig(new MyIceServerConfigImpl());
// Create the session...
WSCSession session = builder.build();
// Handle connection status for the session...
class MyConnectionHandler implements ConnectionCallback {
public void onSuccess() {
...
}
public void onFailure(StatusCode code) {
...
}
}
// Pass the configuration of ICE Server(s)...
class MyIceServerConfigImpl implements IceServerConfig {
public Set<IceServer> getIceServers() {
return ...
}
}
// Listener for changes in session state.
class MySessionObserver extends WSCSession.Observer {
public void stateChanged(SessionState state) {
runOnUiThread(new Runnable() {
switch (state) {
case CONNECTED:
// session is connected, update UI to reflect the change.
break;
case FAILED:
// session is reconnecting, update UI to reflect change and possibly re-login.
break;
...
}
}
}
}