@@ -3,29 +3,35 @@ import 'dart:math' as math;
33import 'package:flutter/material.dart' ;
44
55import 'extensions.dart' ;
6+ import 'participant/participant.dart' ;
67
78typedef CancelListenFunc = Function ();
89
10+ /// Protocol version to use when connecting to server.
11+ /// Usually it's not recommended to change this.
912enum ProtocolVersion {
1013 v2,
1114 v3,
1215 v4,
1316 v5,
1417}
1518
19+ /// Connection state type used throughout the SDK.
1620enum ConnectionState {
1721 disconnected,
1822 connected,
1923 reconnecting,
2024}
2125
26+ /// Connection quality between the [Participant] and server.
2227enum ConnectionQuality {
2328 unknown,
2429 poor,
2530 good,
2631 excellent,
2732}
2833
34+ /// Reliability used for publishing data through data channel.
2935enum Reliability {
3036 reliable,
3137 lossy,
@@ -39,6 +45,8 @@ enum TrackSource {
3945 screenShareAudio,
4046}
4147
48+ /// The state of track data stream.
49+ /// This is controlled by server to optimize bandwidth.
4250enum StreamState {
4351 paused,
4452 active,
@@ -49,31 +57,21 @@ enum CloseReason {
4957 // ...
5058}
5159
60+ /// The reason why a track failed to publish.
5261enum TrackSubscribeFailReason {
5362 invalidServerResponse,
5463 notTrackMetadataFound,
5564 unsupportedTrackType,
5665 // ...
5766}
5867
68+ /// The iceTransportPolicy used for [RTCConfiguration] .
69+ /// See https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection
5970enum RTCIceTransportPolicy {
6071 all,
6172 relay,
6273}
6374
64- @immutable
65- class RTCOfferOptions {
66- final bool iceRestart;
67-
68- const RTCOfferOptions ({
69- this .iceRestart = false ,
70- });
71-
72- Map <String , dynamic > toMap () => < String , dynamic > {
73- if (iceRestart) 'iceRestart' : true ,
74- };
75- }
76-
7775@immutable
7876class RTCConfiguration {
7977 final int ? iceCandidatePoolSize;
@@ -135,6 +133,7 @@ class RTCIceServer {
135133 };
136134}
137135
136+ /// A simple class that represents dimensions of video.
138137@immutable
139138class VideoDimensions {
140139 final int width;
@@ -146,7 +145,7 @@ class VideoDimensions {
146145 );
147146
148147 @override
149- String toString () => 'VideoDimensions (${width }× ${height })' ;
148+ String toString () => '${ runtimeType } (${width }x ${height })' ;
150149
151150 /// Returns the larger value
152151 int max () => math.max (width, height);
0 commit comments