public abstract class PnRTCListener
extends java.lang.Object
PeerConnection.Observer events.Author: Kevin Gleason - Boston College '16 File: PnRTCListener.java Date: 7/20/15 Use: Callback listener for various WebRTC events © 2009 - 2015 PubNub, Inc.
Implement this interface to be notified of WebRTC events. It is an abstract class with default behaviors of doing nothing. Use a PnRTCListener to implement the various callbacks of your WebRTC application.
| Constructor and Description |
|---|
PnRTCListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onAddRemoteStream(org.webrtc.MediaStream remoteStream,
PnPeer peer)
Called when a remote stream is added in the
PeerConnection.Observer
in PnPeer. |
void |
onCallReady(java.lang.String callId) |
void |
onConnected(java.lang.String userId)
Called in
Pubnub object's subscribe connected callback. |
void |
onDebug(PnRTCMessage message)
A helpful debugging callback for testing and developing your app.
|
void |
onLocalStream(org.webrtc.MediaStream localStream)
Called in
PnPeerConnectionClient when setLocalStream
is invoked. |
void |
onMessage(PnPeer peer,
java.lang.Object message)
Called when a user message is send via
Pubnub object. |
void |
onPeerConnectionClosed(PnPeer peer)
TODO: Is this different than onPeerStatusChanged == DISCONNECTED?
Called when a hangup occurs.
|
void |
onPeerStatusChanged(PnPeer peer)
Peer status changed.
|
void |
onRemoveRemoteStream(org.webrtc.MediaStream remoteStream,
PnPeer peer)
Called in the
PeerConnection.Observer implemented
by PnPeer. |
public void onCallReady(java.lang.String callId)
public void onConnected(java.lang.String userId)
Pubnub object's subscribe connected callback.
Means that you are ready to receive calls.userId - The channel you are subscribed to, the userId you may be called on.public void onPeerStatusChanged(PnPeer peer)
PnPeer status changed, can be
CONNECTING, CONNECTED, or DISCONNECTED.peer - The peer object, can use to check peer.getStatus()public void onPeerConnectionClosed(PnPeer peer)
peer - The peer who was hung up on, or who hung up on youpublic void onLocalStream(org.webrtc.MediaStream localStream)
PnPeerConnectionClient when setLocalStream
is invoked.localStream - The users local stream from Android's front or back camera.public void onAddRemoteStream(org.webrtc.MediaStream remoteStream,
PnPeer peer)
PeerConnection.Observer
in PnPeer.remoteStream - The remote stream that was addedpeer - The peer that added the remote stream
Todo: Maybe not the right peer?public void onRemoveRemoteStream(org.webrtc.MediaStream remoteStream,
PnPeer peer)
PeerConnection.Observer implemented
by PnPeer.remoteStream - The stream that was removed by your peerpeer - The peer that removed the stream.public void onMessage(PnPeer peer, java.lang.Object message)
Pubnub object.peer - The peer who sent the messagemessage - The JSONObject message sent by the user.public void onDebug(PnRTCMessage message)
message - The PnRTCMessage debug message.