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

Can send SDP back to server

This commit is contained in:
2020-04-20 17:29:36 +02:00
parent 45d903bcf7
commit 096251eaad
2 changed files with 14 additions and 2 deletions

View File

@ -1,7 +1,10 @@
import 'dart:convert';
import 'package:comunic/helpers/websocket_helper.dart';
import 'package:comunic/lists/call_members_list.dart';
import 'package:comunic/models/call_config.dart';
import 'package:comunic/models/call_member.dart';
import 'package:flutter_webrtc/rtc_session_description.dart';
/// Calls helper
///
@ -38,4 +41,14 @@ class CallsHelper {
/// Request an offer to access another peer's stream
static Future<void> requestOffer(int callID, int peerID) async =>
await ws("calls/request_offer", {"callID": callID, "peerID": peerID});
/// Send a Session Description message to the server
static Future<void> sendSessionDescription(
int callID, int peerID, RTCSessionDescription sdp) async =>
await ws("calls/signal", {
"callID": callID,
"peerID": peerID,
"type": "SDP",
"data": jsonEncode(sdp.toMap())
});
}