From e229a0450ff25e1cd07cf93f25bb23648065dfc4 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 13 Aug 2023 18:21:55 +0200 Subject: [PATCH] feat: Enable beta videocalls for linux --- .../settings_chat/settings_chat_view.dart | 24 +++++++++---------- lib/widgets/matrix.dart | 8 +------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/pages/settings_chat/settings_chat_view.dart b/lib/pages/settings_chat/settings_chat_view.dart index 97970b178..76522bffa 100644 --- a/lib/pages/settings_chat/settings_chat_view.dart +++ b/lib/pages/settings_chat/settings_chat_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -77,18 +76,17 @@ class SettingsChatView extends StatelessWidget { storeKey: SettingKeys.sendOnEnter, defaultValue: AppConfig.sendOnEnter, ), - if (Matrix.of(context).webrtcIsSupported) - SettingsSwitchListTile.adaptive( - title: L10n.of(context)!.experimentalVideoCalls, - onChanged: (b) { - AppConfig.experimentalVoip = b; - Matrix.of(context).createVoipPlugin(); - return; - }, - storeKey: SettingKeys.experimentalVoip, - defaultValue: AppConfig.experimentalVoip, - ), - if (Matrix.of(context).webrtcIsSupported && !kIsWeb) + SettingsSwitchListTile.adaptive( + title: L10n.of(context)!.experimentalVideoCalls, + onChanged: (b) { + AppConfig.experimentalVoip = b; + Matrix.of(context).createVoipPlugin(); + return; + }, + storeKey: SettingKeys.experimentalVoip, + defaultValue: AppConfig.experimentalVoip, + ), + if (PlatformInfos.isMobile) ListTile( title: Text(L10n.of(context)!.callingPermissions), onTap: () => diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 5547101f8..fc1d0a524 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -78,12 +78,6 @@ class MatrixState extends State with WidgetsBindingObserver { return widget.clients[_activeClient]; } - bool get webrtcIsSupported => - kIsWeb || - PlatformInfos.isMobile || - PlatformInfos.isWindows || - PlatformInfos.isMacOS; - VoipPlugin? voipPlugin; bool get isMultiAccount => widget.clients.length > 1; @@ -406,7 +400,7 @@ class MatrixState extends State with WidgetsBindingObserver { voipPlugin = null; return; } - voipPlugin = webrtcIsSupported ? VoipPlugin(this) : null; + voipPlugin = VoipPlugin(this); } @override