mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
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:
parent
64c4f8c7ee
commit
4457e92504
3 changed files with 9 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue