Handle 1:1 call reconnecting events.

This commit is contained in:
Cody Henthorne
2022-03-22 21:12:40 -04:00
committed by Greyson Parrelli
parent 3af53f2089
commit 403958fed3
10 changed files with 34 additions and 8 deletions

View File

@@ -278,7 +278,7 @@ data class CallParticipantsState(
if (isExpanded && (localParticipant.isVideoEnabled || isNonIdleGroupCall)) {
return WebRtcLocalRenderState.EXPANDED
} else if (displayLocal || showVideoForOutgoing) {
if (callState == WebRtcViewModel.State.CALL_CONNECTED) {
if (callState == WebRtcViewModel.State.CALL_CONNECTED || callState == WebRtcViewModel.State.CALL_RECONNECTING) {
localRenderState = if (isViewingFocusedParticipant || numberOfRemoteParticipants > 1) {
WebRtcLocalRenderState.SMALLER_RECTANGLE
} else if (numberOfRemoteParticipants == 1) {

View File

@@ -349,6 +349,9 @@ public class WebRtcCallViewModel extends ViewModel {
case NETWORK_FAILURE:
callState = WebRtcControls.CallState.ERROR;
break;
case CALL_RECONNECTING:
callState = WebRtcControls.CallState.RECONNECTING;
break;
default:
callState = WebRtcControls.CallState.ONGOING;
}

View File

@@ -142,7 +142,7 @@ public final class WebRtcControls {
}
boolean displayEndCall() {
return isAtLeastOutgoing();
return isAtLeastOutgoing() || callState == CallState.RECONNECTING;
}
boolean displayMuteAudio() {
@@ -182,7 +182,7 @@ public final class WebRtcControls {
}
boolean isFadeOutEnabled() {
return isAtLeastOutgoing() && isRemoteVideoEnabled;
return isAtLeastOutgoing() && isRemoteVideoEnabled && callState != CallState.RECONNECTING;
}
boolean displaySmallOngoingCallButtons() {
@@ -248,6 +248,7 @@ public final class WebRtcControls {
NONE,
ERROR,
PRE_JOIN,
RECONNECTING,
INCOMING,
OUTGOING,
ONGOING,