public class PnPeerConnectionClient
extends java.lang.Object
PnRTCClient
Author: Kevin Gleason - Boston College '16 File: PnPeerConnectionClient.java Date: 7/20/15 Use: WebRTC PeerConnection Manager © 2009 - 2015 PubNub, Inc.
PnPeerConnectionClient
is used to manage peer connections.Constructor and Description |
---|
PnPeerConnectionClient(com.pubnub.api.Pubnub pubnub,
PnSignalingParams signalingParams,
PnRTCListener rtcListener) |
Modifier and Type | Method and Description |
---|---|
void |
closeAllConnections()
Close connections (hangup) on all open connections.
|
void |
closeConnection(java.lang.String id)
Close connection (hangup) no a certain peer.
|
static JSONObject |
generateHangupPacket(java.lang.String userId) |
static JSONObject |
generateUserMessage(java.lang.String userId,
JSONObject message)
Static method to generate the proper JSON for a user message.
|
org.webrtc.MediaStream |
getLocalMediaStream() |
void |
setLocalMediaStream(org.webrtc.MediaStream localStream) |
void |
setRTCListener(PnRTCListener listener) |
public PnPeerConnectionClient(com.pubnub.api.Pubnub pubnub, PnSignalingParams signalingParams, PnRTCListener rtcListener)
public void setRTCListener(PnRTCListener listener)
public void setLocalMediaStream(org.webrtc.MediaStream localStream)
public org.webrtc.MediaStream getLocalMediaStream()
public void closeConnection(java.lang.String id)
id
- PnPeer id to close connection withpublic void closeAllConnections()
public static JSONObject generateHangupPacket(java.lang.String userId)
userId
- Your id. Used to tag the message before publishing it to another user.public static JSONObject generateUserMessage(java.lang.String userId, JSONObject message)
PnRTCClient
instantiated. Simply send a publish with the
returned JSONObject to the ID that a user is subscribed to.userId
- Your UserID, needed to tag the messagemessage
- The message you with to send some other user