Android SDK API Reference
|
Classes | |
enum | DebugLevelEnum |
Debug output level. More... | |
enum | PeerEventEnum |
Event callback type. More... | |
enum | PeerTypeEnum |
Public Member Functions | |
String | identity () |
Get the current Peer ID. More... | |
boolean | isDisconnected () |
Get the disconnection state. More... | |
boolean | isDestroyed () |
Get the disconnection state. More... | |
Context | getContext () |
Get the context for the creation of a Peer object. More... | |
DebugLevelEnum | getDebugLevel () |
Get the current debug level. More... | |
Peer (Context context, PeerOption options) | |
Create a Peer object. More... | |
Peer (Context context, String peerId, PeerOption options) | |
Initialization will be performed with the specified Peer ID and configuration information. More... | |
void | finalize () |
void | on (PeerEventEnum event, OnCallback callback) |
Sets the event callback block for the Peer. More... | |
void | disconnect () |
(deprecated) Disconnect the connection to the signaling server. More... | |
void | reconnect () |
(deprecated) Reconnect to the signaling server. More... | |
void | destroy () |
Close the connection to the signaling server and the already connected mediaConnection and dataConnection. More... | |
void | listAllPeers (OnCallback callback) |
Obtain a list of available Peer IDs from the signaling server. More... | |
void | fetchPeerExists (String peerId, OnCallback successCallback, OnCallback errorCallBack) |
Fetch whether Peer specified by Peer ID exists from the signaling server. More... | |
DataConnection | connect (String peerId) |
Make a data connection to the specified remote and return a DataConnection. More... | |
DataConnection | connect (String peerId, ConnectOption option) |
Make a data connection to the specified remote and return a DataConnection. More... | |
MediaConnection | call (String peerId, MediaStream stream) |
Makes a media connection to the specified remote and returns a MediaConnection. More... | |
MediaConnection | call (String peerId, MediaStream stream, CallOption option) |
Makes a media connection to the specified remote and returns a MediaConnection. More... | |
Room | joinRoom (String roomName, RoomOption option) |
Join room. More... | |
void | updateCredential (PeerCredential newCredential) |
update credential More... | |
EglBase | getEglBase () |
MediaStream | getUserMedia (MediaConstraints constraints) |
MediaStream | getDisplayMedia (MediaConstraints constraints, Intent mediaProjectionPermissionResultData, MediaProjection.Callback mediaProjectionCallback) |
Static Public Member Functions | |
static String | getSdkVersion () |
Getting current SDK version. More... | |
Public Attributes | |
final Map< String, ArrayList< BaseConnection > > | connections = new HashMap<>() |
Connection connection management object. More... | |
Peer class.
io.skyway.Peer.Peer.Peer | ( | Context | context, |
PeerOption | options | ||
) |
Create a Peer object.
The peer ID is obtained from the server.
context | |
options |
io.skyway.Peer.Peer.Peer | ( | Context | context, |
String | peerId, | ||
PeerOption | options | ||
) |
Initialization will be performed with the specified Peer ID and configuration information.
context | Specify an ApplicationContext object. |
peerId | |
options | Set the ConnectOption object. |
MediaConnection io.skyway.Peer.Peer.call | ( | String | peerId, |
MediaStream | stream | ||
) |
Makes a media connection to the specified remote and returns a MediaConnection.
In case of failure, an error event is thrown. Connect with the default connection options.
peerId | The Peer ID of the remote |
stream | Sets the MediaStream retrieved by getUserMedia() of the Navigator class; if null , no video or audio from the own device will be sent to the other party. |
MediaConnection io.skyway.Peer.Peer.call | ( | String | peerId, |
MediaStream | stream, | ||
CallOption | option | ||
) |
Makes a media connection to the specified remote and returns a MediaConnection.
In case of failure, an error event is raised. Connect with the configuration information.
peerId | The Peer ID of the remote |
stream | Sets the MediaStream retrieved by getUserMedia() of the Navigator class; if null , no video or audio from the own device will be sent to the other party. |
option | Set ConnectOption Object |
DataConnection io.skyway.Peer.Peer.connect | ( | String | peerId | ) |
Make a data connection to the specified remote and return a DataConnection.
In case of failure, an error event is invoked. The connection is made with the default settings.
peerId | The Peer ID to connect to |
DataConnection io.skyway.Peer.Peer.connect | ( | String | peerId, |
ConnectOption | option | ||
) |
Make a data connection to the specified remote and return a DataConnection.
In case of failure, an error event is called. The connection is made with configuration information.
peerId | The Peer ID to connect to |
option | Sets the ConnectOption object. |
void io.skyway.Peer.Peer.destroy | ( | ) |
Close the connection to the signaling server and the already connected mediaConnection and dataConnection.
void io.skyway.Peer.Peer.disconnect | ( | ) |
(deprecated) Disconnect the connection to the signaling server.
In addition, the connected mediaConnection and dataConnection are continued.
void io.skyway.Peer.Peer.fetchPeerExists | ( | String | peerId, |
OnCallback | successCallback, | ||
OnCallback | errorCallBack | ||
) |
Fetch whether Peer specified by Peer ID exists from the signaling server.
Context io.skyway.Peer.Peer.getContext | ( | ) |
Get the context for the creation of a Peer object.
DebugLevelEnum io.skyway.Peer.Peer.getDebugLevel | ( | ) |
Get the current debug level.
|
static |
Getting current SDK version.
boolean io.skyway.Peer.Peer.isDestroyed | ( | ) |
Get the disconnection state.
boolean io.skyway.Peer.Peer.isDisconnected | ( | ) |
Get the disconnection state.
Room io.skyway.Peer.Peer.joinRoom | ( | String | roomName, |
RoomOption | option | ||
) |
Join room.
Full mesh room example:
SFU room example:
void io.skyway.Peer.Peer.listAllPeers | ( | OnCallback | callback | ) |
Obtain a list of available Peer IDs from the signaling server.
an ArrayList of strings is passed.
callback | Set the callback object to be executed when the list acquisition is completed. |
void io.skyway.Peer.Peer.on | ( | PeerEventEnum | event, |
OnCallback | callback | ||
) |
Sets the event callback block for the Peer.
event | Set the event type to be set. |
callback | Set the callback object to be executed when the event occurs. |
void io.skyway.Peer.Peer.reconnect | ( | ) |
(deprecated) Reconnect to the signaling server.
Use the assigned Peer ID when reconnecting.
void io.skyway.Peer.Peer.updateCredential | ( | PeerCredential | newCredential | ) |
update credential
newCredential | new credential |