mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 11:45:10 +00:00
feat: Enable beta videocalls for linux
This commit is contained in:
parent
f36d5f8a89
commit
e229a0450f
2 changed files with 12 additions and 20 deletions
|
@ -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: () =>
|
||||
|
|
|
@ -78,12 +78,6 @@ class MatrixState extends State<Matrix> 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<Matrix> with WidgetsBindingObserver {
|
|||
voipPlugin = null;
|
||||
return;
|
||||
}
|
||||
voipPlugin = webrtcIsSupported ? VoipPlugin(this) : null;
|
||||
voipPlugin = VoipPlugin(this);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue