-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathrtc_configuration.dart
66 lines (58 loc) · 1.83 KB
/
rtc_configuration.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class RTCOfferOptions {
bool? iceRestart;
bool? offerToReceiveAudio;
bool? offerToReceiveVideo;
bool? voiceActivityDetection;
}
class RTCAnswerOptions {
bool? voiceActivityDetection;
}
class RTCConfiguration {
RTCConfiguration(
{this.iceServers,
this.rtcpMuxPolicy,
this.iceTransportPolicy,
this.peerIdentity,
this.iceCandidatePoolSize,
this.bundlePolicy});
factory RTCConfiguration.fromMap(Map<String, dynamic> map) {
return RTCConfiguration(
iceServers: map['iceServers'] != null
? (map['iceServers'] as List)
.map((e) => RTCIceServer.fromMap(e))
.toList()
: null,
rtcpMuxPolicy: map['rtcpMuxPolicy'],
iceTransportPolicy: map['iceTransportPolicy'],
peerIdentity: map['peerIdentity'],
iceCandidatePoolSize: map['iceCandidatePoolSize'],
bundlePolicy: map['bundlePolicy'],
);
}
List<RTCIceServer>? iceServers;
///Optional: 'negotiate' or 'require'
String? rtcpMuxPolicy;
///Optional: 'relay' or 'all'
String? iceTransportPolicy;
/// A DOMString which specifies the target peer identity for the
/// RTCPeerConnection. If this value is set (it defaults to null),
/// the RTCPeerConnection will not connect to a remote peer unless
/// it can successfully authenticate with the given name.
String? peerIdentity;
int? iceCandidatePoolSize;
///Optional: 'balanced' | 'max-compat' | 'max-bundle'
String? bundlePolicy;
}
class RTCIceServer {
RTCIceServer({this.urls, this.username, this.credential});
factory RTCIceServer.fromMap(Map<String, dynamic> map) {
return RTCIceServer(
urls: map['urls'] != null ? List<String>.from(map['urls']) : null,
username: map['username'],
credential: map['credential'],
);
}
List<String>? urls;
String? username;
String? credential;
}