public interface

RemotePeerListener

sg.com.temasys.skylink.sdk.listener.RemotePeerListener
Known Indirect Subclasses

Class Overview

Listener comprises of callbacks related to the remote peers' activities.

Summary

Public Methods
abstract void onConnectWithRemotePeer(String remotePeerId, UserInfo userInfo, boolean hasDataChannel)
This is triggered when remote peer connection was established successfully.
abstract void onDisconnectWithRemotePeer(String remotePeerId, UserInfo userInfo, boolean hasDataChannel)
This is triggered when the remote peer connection is closed.
abstract 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
abstract 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).
abstract void onReceiveRemotePeerJoinRoom(String remotePeerId, UserInfo userInfo)
This is triggered when a remote peer joins the room.
abstract void onReceiveRemotePeerLeaveRoom(String remotePeerId, SkylinkInfo skylinkInfo, UserInfo userInfo)
This is triggered when a remote peer leaves the room.
abstract void onReceiveRemotePeerUserData(Object userData, String remotePeerId)
This is triggered when an update is received in the user defined data of a remote peer.
abstract void onRefreshRemotePeerConnection(String remotePeerId, UserInfo userInfo, boolean hasDataChannel, boolean isIceRestarted)
This is triggered when the connection with a remote peer is refreshed.

Public Methods

public abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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.