1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 15:03:22 +00:00
comunicmobile/lib/helpers/calls_helper.dart

25 lines
634 B
Dart
Raw Normal View History

2020-04-20 11:24:40 +00:00
import 'package:comunic/helpers/websocket_helper.dart';
2020-04-20 11:43:17 +00:00
import 'package:comunic/models/call_config.dart';
2020-04-20 11:24:40 +00:00
/// Calls helper
///
/// @author Pierre Hubert
class CallsHelper {
/// Join a call
static Future<void> join(int convID) async =>
2020-04-20 11:43:17 +00:00
await ws("calls/join", {"convID": convID});
2020-04-20 11:24:40 +00:00
/// Leave a call
static Future<void> leave(int convID) async =>
2020-04-20 11:43:17 +00:00
await ws("calls/leave", {"convID": convID});
/// Get calls configuration
static Future<CallConfig> getConfig() async {
final response = await ws("calls/config", {});
return CallConfig(
iceServers: response["iceServers"].cast<String>(),
);
}
2020-04-20 11:24:40 +00:00
}