@stream-io/video-client 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,13 @@ export declare class Publisher {
38
38
  private readonly iceRestartDelay;
39
39
  private isIceRestarting;
40
40
  private iceRestartTimeout?;
41
+ private _connectionConfiguration;
42
+ /**
43
+ * Returns the current connection configuration.
44
+ *
45
+ * @internal
46
+ */
47
+ get connectionConfiguration(): RTCConfiguration | undefined;
41
48
  /**
42
49
  * The SFU client instance to use for publishing and signaling.
43
50
  */
@@ -55,12 +62,6 @@ export declare class Publisher {
55
62
  */
56
63
  constructor({ connectionConfig, sfuClient, dispatcher, state, isDtxEnabled, isRedEnabled, iceRestartDelay, }: PublisherConstructorOpts);
57
64
  private createPeerConnection;
58
- /**
59
- * Returns the current connection configuration.
60
- *
61
- * @internal
62
- */
63
- get connectionConfiguration(): RTCConfiguration;
64
65
  /**
65
66
  * Closes the publisher PeerConnection and cleans up the resources.
66
67
  */
@@ -21,6 +21,13 @@ export declare class Subscriber {
21
21
  private readonly iceRestartDelay;
22
22
  private isIceRestarting;
23
23
  private iceRestartTimeout?;
24
+ private _connectionConfiguration;
25
+ /**
26
+ * Returns the current connection configuration.
27
+ *
28
+ * @internal
29
+ */
30
+ get connectionConfiguration(): RTCConfiguration | undefined;
24
31
  /**
25
32
  * Constructs a new `Subscriber` instance.
26
33
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -98,6 +98,19 @@ export class Publisher {
98
98
  private isIceRestarting = false;
99
99
  private iceRestartTimeout?: NodeJS.Timeout;
100
100
 
101
+ // workaround for the lack of RTCPeerConnection.getConfiguration() method in react-native-webrtc
102
+ private _connectionConfiguration: RTCConfiguration | undefined;
103
+
104
+ /**
105
+ * Returns the current connection configuration.
106
+ *
107
+ * @internal
108
+ */
109
+ get connectionConfiguration() {
110
+ if (this.pc.getConfiguration) return this.pc.getConfiguration();
111
+ return this._connectionConfiguration;
112
+ }
113
+
101
114
  /**
102
115
  * The SFU client instance to use for publishing and signaling.
103
116
  */
@@ -143,6 +156,7 @@ export class Publisher {
143
156
 
144
157
  private createPeerConnection = (connectionConfig?: RTCConfiguration) => {
145
158
  const pc = new RTCPeerConnection(connectionConfig);
159
+ this._connectionConfiguration = connectionConfig;
146
160
  pc.addEventListener('icecandidate', this.onIceCandidate);
147
161
  pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);
148
162
 
@@ -159,15 +173,6 @@ export class Publisher {
159
173
  return pc;
160
174
  };
161
175
 
162
- /**
163
- * Returns the current connection configuration.
164
- *
165
- * @internal
166
- */
167
- get connectionConfiguration() {
168
- return this.pc.getConfiguration();
169
- }
170
-
171
176
  /**
172
177
  * Closes the publisher PeerConnection and cleans up the resources.
173
178
  */
@@ -563,6 +568,7 @@ export class Publisher {
563
568
  ) => {
564
569
  this.sfuClient = sfuClient;
565
570
  this.pc.setConfiguration(connectionConfig);
571
+ this._connectionConfiguration = connectionConfig;
566
572
 
567
573
  const shouldRestartIce = this.pc.iceConnectionState === 'connected';
568
574
  if (shouldRestartIce) {
@@ -32,6 +32,19 @@ export class Subscriber {
32
32
  private isIceRestarting = false;
33
33
  private iceRestartTimeout?: NodeJS.Timeout;
34
34
 
35
+ // workaround for the lack of RTCPeerConnection.getConfiguration() method in react-native-webrtc
36
+ private _connectionConfiguration: RTCConfiguration | undefined;
37
+
38
+ /**
39
+ * Returns the current connection configuration.
40
+ *
41
+ * @internal
42
+ */
43
+ get connectionConfiguration() {
44
+ if (this.pc.getConfiguration) return this.pc.getConfiguration();
45
+ return this._connectionConfiguration;
46
+ }
47
+
35
48
  /**
36
49
  * Constructs a new `Subscriber` instance.
37
50
  *
@@ -81,6 +94,7 @@ export class Subscriber {
81
94
  */
82
95
  private createPeerConnection = (connectionConfig?: RTCConfiguration) => {
83
96
  const pc = new RTCPeerConnection(connectionConfig);
97
+ this._connectionConfiguration = connectionConfig;
84
98
  pc.addEventListener('icecandidate', this.onIceCandidate);
85
99
  pc.addEventListener('track', this.handleOnTrack);
86
100