public class

RemotePeerAdapter

extends Object
implements RemotePeerListener
java.lang.Object
   ↳ sg.com.temasys.skylink.sdk.adapter.RemotePeerAdapter

Summary

Public Constructors
RemotePeerAdapter()
Public Methods
void onConnectWithRemotePeer(String remotePeerId, UserInfo userInfo, boolean hasDataChannel)
This is triggered when remote peer connection was established successfully.
void onDisconnectWithRemotePeer(String remotePeerId, UserInfo userInfo, boolean hasDataChannel)
This is triggered when the remote peer connection is closed.
void onErrorForRemotePeerConnection(SkylinkError skylinkError, HashMap<String, Object> details)
This is triggered when having fail connection with a remote peer When user get this callback, they can reconnect or refresh the connection with the remote peer, or simply ignore this peer
void onOpenRemotePeerDataConnection(String remotePeerId)
This is triggered when the underlying peer to peer data connection is established with a remote peer and is ready to send and receive peer messages and data (including files).
void onReceiveRemotePeerJoinRoom(String remotePeerId, UserInfo userInfo)
This is triggered when a remote peer joins the room.
void onReceiveRemotePeerLeaveRoom(String remotePeerId, SkylinkInfo skylinkInfo, UserInfo userInfo)
This is triggered when a remote peer leaves the room.
void onReceiveRemotePeerUserData(Object userData, String remotePeerId)
This is triggered when an update is received in the user defined data of a remote peer.
void onRefreshRemotePeerConnection(String remotePeerId, UserInfo userInfo, boolean hasDataChannel, boolean isIceRestarted)
This is triggered when the connection with a remote peer is refreshed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sg.com.temasys.skylink.sdk.listener.RemotePeerListener

Public Constructors

public RemotePeerAdapter ()

Public Methods

public void onConnectWithRemotePeer (String remotePeerId, UserInfo userInfo, boolean hasDataChannel)

This is triggered when remote peer connection was established successfully. It will be triggered before onRemotePeerMediaReceive is triggered

Parameters
remotePeerId The id of the remote peer
userInfo The info of the user, including userData. UserData may be a 'java.lang.String', 'org.json.JSONObject' or 'org.json.JSONArray' or null
hasDataChannel Whether peer has enabled DataChannel.

public void onDisconnectWithRemotePeer (String remotePeerId, UserInfo userInfo, boolean hasDataChannel)

This is triggered when the remote peer connection is closed.

Parameters
remotePeerId The id of the remote peer
userInfo UserInfo of this remote Peer.
hasDataChannel Whether remote peer has data channel

public void onErrorForRemotePeerConnection (SkylinkError skylinkError, HashMap<String, Object> details)

This is triggered when having fail connection with a remote peer When user get this callback, they can reconnect or refresh the connection with the remote peer, or simply ignore this peer

Parameters
skylinkError SkylinkError with more details about this error.
details Additional details for failed connection in a map.

public void onOpenRemotePeerDataConnection (String remotePeerId)

This is triggered when the underlying peer to peer data connection is established with a remote peer and is ready to send and receive peer messages and data (including files). Note: This callback is currently not supported when Skylink Media Relay is active.

Parameters
remotePeerId The id of the remote peer

public void onReceiveRemotePeerJoinRoom (String remotePeerId, UserInfo userInfo)

This is triggered when a remote peer joins the room. It will be triggered before onConnectWithRemotePeer is triggered

Parameters
remotePeerId The id of the remote peer.
userInfo The info of the user, including userData. UserData may be a 'java.lang.String', 'org.json.JSONObject' or 'org.json.JSONArray' or null

public void onReceiveRemotePeerLeaveRoom (String remotePeerId, SkylinkInfo skylinkInfo, UserInfo userInfo)

This is triggered when a remote peer leaves the room. This is triggered after onDisconnectWithRemotePeer(String, UserInfo, boolean)

Parameters
remotePeerId The id of the remote peer
skylinkInfo The SkylinkInfo with more details on this event of Peer leaving room.
userInfo UserInfo of this remote Peer.

public void onReceiveRemotePeerUserData (Object userData, String remotePeerId)

This is triggered when an update is received in the user defined data of a remote peer.

Parameters
userData User defined data relating to the remote peer. May be a 'java.lang.String', 'org.json.JSONObject' or 'org.json.JSONArray' or null
remotePeerId The id of the remote peer.

public void onRefreshRemotePeerConnection (String remotePeerId, UserInfo userInfo, boolean hasDataChannel, boolean isIceRestarted)

This is triggered when the connection with a remote peer is refreshed. Note that when Skylink Media Relay is active, all remote Peers' connections will be refreshed when one is refreshed.

Parameters
remotePeerId The id of the remote peer.
userInfo Info of the remote user, including userData. UserData may be a 'java.lang.String', 'org.json.JSONObject' or 'org.json.JSONArray' or null
hasDataChannel Whether peer has enabled DataChannel.
isIceRestarted Indicates if ICE restart was done when PeerConnection was refreshed.