Przeglądaj źródła

Merge pull request #2395 from nextcloud/show-message-in-call-state-when-the-publisher-failed

Show message in call state when the publisher failed
Tim Krüger 2 lat temu
rodzic
commit
b3a3277aa2

+ 20 - 1
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -2132,7 +2132,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);
         }
@@ -2397,6 +2397,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();