mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Get calls configuration
This commit is contained in:
		@@ -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>(),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user