Show message in call state when the publisher failed

When the HPB is used and the publisher fails (which is a disconnection
that can not be automatically solved by itself) a forced reconnection is
triggered. This restarts the call, so some feedback should be provided
in the UI about it.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2022-09-19 01:57:25 +02:00
parent 53e3543839
commit c21e1d7360

View File

@ -2089,7 +2089,7 @@ public class CallActivity extends CallBaseActivity {
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED) {
currentCallStatus = CallStatus.PUBLISHER_FAILED;
setCallState(CallStatus.PUBLISHER_FAILED);
webSocketClient.clearResumeId();
hangup(false);
}
@ -2345,6 +2345,25 @@ public class CallActivity extends CallBaseActivity {
}
});
break;
case PUBLISHER_FAILED:
handler.post(() -> {
// No calling sound when the publisher failed
binding.callStates.callStateTextView.setText(R.string.nc_call_reconnecting);
binding.callModeTextView.setText(getDescriptionForCallType());
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.VISIBLE) {
binding.callStates.callStateRelativeLayout.setVisibility(View.VISIBLE);
}
if (binding.gridview.getVisibility() != View.INVISIBLE) {
binding.gridview.setVisibility(View.INVISIBLE);
}
if (binding.callStates.callStateProgressBar.getVisibility() != View.VISIBLE) {
binding.callStates.callStateProgressBar.setVisibility(View.VISIBLE);
}
if (binding.callStates.errorImageView.getVisibility() != View.GONE) {
binding.callStates.errorImageView.setVisibility(View.GONE);
}
});
break;
case RECONNECTING:
handler.post(() -> {
playCallingSound();