Generalize PUBLISHER_FAILED event

Rather than emitting PUBLISHER_FAILED when the publisher connection
fails now PEER_FAILED is emitted when any connection fails, and the
handler checks if the connection was the publisher one to apply the
specific behaviour.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2022-11-22 13:33:26 +01:00
parent 64c4f8c7ee
commit 4457e92504
3 changed files with 9 additions and 8 deletions

View file

@ -2153,10 +2153,12 @@ public class CallActivity extends CallBaseActivity {
}
}
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED) {
setCallState(CallStatus.PUBLISHER_FAILED);
webSocketClient.clearResumeId();
hangup(false);
PeerConnectionEvent.PeerConnectionEventType.PEER_FAILED) {
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
setCallState(CallStatus.PUBLISHER_FAILED);
webSocketClient.clearResumeId();
hangup(false);
}
}
}

View file

@ -120,6 +120,6 @@ public class PeerConnectionEvent {
}
public enum PeerConnectionEventType {
PEER_CONNECTED, PEER_DISCONNECTED, PEER_CLOSED, SENSOR_FAR, SENSOR_NEAR, PUBLISHER_FAILED
PEER_CONNECTED, PEER_DISCONNECTED, PEER_FAILED, PEER_CLOSED, SENSOR_FAR, SENSOR_NEAR
}
}

View file

@ -432,9 +432,8 @@ public class PeerConnectionWrapper {
} else if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED,
sessionId, null, null, videoStreamType));
if (isMCUPublisher) {
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED, sessionId, null, null, videoStreamType));
}
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_FAILED,
sessionId, null, null, videoStreamType));
}
}