diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
index 19a707460..6fd1c39e3 100644
--- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
@@ -1168,7 +1168,7 @@ public class RtpSessionActivity extends XmppActivity
MainThreadExecutor.getInstance());
}
- private void enableVideo(View view) {
+ private void enableVideo(final View view) {
try {
requireRtpConnection().setVideoEnabled(true);
} catch (final IllegalStateException e) {
@@ -1178,14 +1178,19 @@ public class RtpSessionActivity extends XmppActivity
updateInCallButtonConfigurationVideo(true, requireRtpConnection().isCameraSwitchable());
}
- private void disableVideo(View view) {
+ private void disableVideo(final View view) {
final JingleRtpConnection rtpConnection = requireRtpConnection();
final ContentAddition pending = rtpConnection.getPendingContentAddition();
if (pending != null && pending.direction == ContentAddition.Direction.OUTGOING) {
rtpConnection.retractContentAdd();
return;
}
- requireRtpConnection().setVideoEnabled(false);
+ try {
+ requireRtpConnection().setVideoEnabled(false);
+ } catch (final IllegalStateException e) {
+ Toast.makeText(this, R.string.could_not_disable_video, Toast.LENGTH_SHORT).show();
+ return;
+ }
updateInCallButtonConfigurationVideo(false, requireRtpConnection().isCameraSwitchable());
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index fb5a36b82..858470e55 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -1000,6 +1000,7 @@
No active accounts support this feature
The backup has been started. You’ll get a notification once it has been completed.
Unable to enable video.
+ Could not disable video.
Plain text document
Account registrations are not supported
No Jabber ID found