You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've read your source code and dont understand this snippet code in class PnPeerConnectionClient:
private class CreateAnswerAction implements PnAction{
public static final String TRIGGER = "offer";
public void execute(String peerId, JSONObject payload) throws JSONException {
Log.d("CAAction","CreateAnswerAction");
PnPeer peer = peers.get(peerId);
peer.setType(PnPeer.TYPE_OFFER);
peer.setStatus(PnPeer.STATUS_CONNECTED);
SessionDescription sdp = new SessionDescription(
SessionDescription.Type.fromCanonicalForm(payload.getString("type")),
payload.getString("sdp")
);
peer.pc.setRemoteDescription(peer, sdp);
peer.pc.createAnswer(peer, signalingParams.pcConstraints);
}
}
private class SetRemoteSDPAction implements PnAction{
public static final String TRIGGER = "answer";
public void execute(String peerId, JSONObject payload) throws JSONException {
Log.d("SRSAction","SetRemoteSDPAction");
PnPeer peer = peers.get(peerId);
SessionDescription sdp = new SessionDescription(
SessionDescription.Type.fromCanonicalForm(payload.getString("type")),
payload.getString("sdp")
);
peer.pc.setRemoteDescription(peer, sdp);
}
}`
It looks useless and isnt used anywhere else. As I understand, the recipient has to create an answer and call setRemoteDescription. So could you explain it please?
Thank in advance.
The text was updated successfully, but these errors were encountered:
Hi` @GleasonK,
I'm new at webrtc
I've read your source code and dont understand this snippet code in class PnPeerConnectionClient:
private class CreateAnswerAction implements PnAction{
public static final String TRIGGER = "offer";
public void execute(String peerId, JSONObject payload) throws JSONException {
Log.d("CAAction","CreateAnswerAction");
PnPeer peer = peers.get(peerId);
peer.setType(PnPeer.TYPE_OFFER);
peer.setStatus(PnPeer.STATUS_CONNECTED);
SessionDescription sdp = new SessionDescription(
SessionDescription.Type.fromCanonicalForm(payload.getString("type")),
payload.getString("sdp")
);
peer.pc.setRemoteDescription(peer, sdp);
peer.pc.createAnswer(peer, signalingParams.pcConstraints);
}
}
It looks useless and isnt used anywhere else. As I understand, the recipient has to create an answer and call setRemoteDescription. So could you explain it please?
Thank in advance.
The text was updated successfully, but these errors were encountered: