1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Get calls configuration

This commit is contained in:
2020-04-20 13:43:17 +02:00
parent 391d3150dd
commit 04693cc163
3 changed files with 29 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import 'package:comunic/helpers/websocket_helper.dart';
import 'package:comunic/models/call_config.dart';
/// Calls helper
///
@ -7,9 +8,17 @@ import 'package:comunic/helpers/websocket_helper.dart';
class CallsHelper {
/// Join a call
static Future<void> join(int convID) async =>
ws("calls/join", {"convID": convID});
await ws("calls/join", {"convID": convID});
/// Leave a call
static Future<void> leave(int convID) async =>
ws("calls/leave", {"convID": convID});
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>(),
);
}
}