@whereby.com/media 11.3.1 → 11.3.3

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.
package/dist/index.cjs CHANGED
@@ -181,35 +181,37 @@ function rtcStatsConnection(wsURL, logger = console) {
181
181
  clientInfo.connectionNumber++;
182
182
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
183
183
  ws.send(JSON.stringify(["webrtcapihealth", null, webrtcapihealthcheck.getWebRtcApiHealth()]));
184
- if (organizationId) {
185
- ws.send(JSON.stringify(organizationId));
186
- }
187
- if (clientId) {
188
- ws.send(JSON.stringify(clientId));
189
- }
190
- if (roomSessionId) {
191
- ws.send(JSON.stringify(roomSessionId));
192
- }
193
- if (displayName) {
194
- ws.send(JSON.stringify(displayName));
195
- }
196
- if (userRole) {
197
- ws.send(JSON.stringify(userRole));
198
- }
199
- if (deviceId) {
200
- ws.send(JSON.stringify(deviceId));
201
- }
202
- if (roomMode) {
203
- ws.send(JSON.stringify(roomMode));
204
- }
205
- if (roomProduct) {
206
- ws.send(JSON.stringify(roomProduct));
207
- }
208
- if (sfuServer) {
209
- ws.send(JSON.stringify(sfuServer));
210
- }
211
- if (featureFlags) {
212
- ws.send(JSON.stringify(featureFlags));
184
+ if (clientInfo.connectionNumber > 1) {
185
+ if (organizationId) {
186
+ ws.send(JSON.stringify(organizationId));
187
+ }
188
+ if (clientId) {
189
+ ws.send(JSON.stringify(clientId));
190
+ }
191
+ if (roomSessionId) {
192
+ ws.send(JSON.stringify(roomSessionId));
193
+ }
194
+ if (displayName) {
195
+ ws.send(JSON.stringify(displayName));
196
+ }
197
+ if (userRole) {
198
+ ws.send(JSON.stringify(userRole));
199
+ }
200
+ if (deviceId) {
201
+ ws.send(JSON.stringify(deviceId));
202
+ }
203
+ if (roomMode) {
204
+ ws.send(JSON.stringify(roomMode));
205
+ }
206
+ if (roomProduct) {
207
+ ws.send(JSON.stringify(roomProduct));
208
+ }
209
+ if (sfuServer) {
210
+ ws.send(JSON.stringify(sfuServer));
211
+ }
212
+ if (featureFlags) {
213
+ ws.send(JSON.stringify(featureFlags));
214
+ }
213
215
  }
214
216
  while (buffer.length) {
215
217
  ws.send(JSON.stringify(buffer.shift()));
@@ -7876,10 +7878,14 @@ function getStream(constraintOpt_1) {
7876
7878
  });
7877
7879
  }
7878
7880
  function hasGetDisplayMedia() {
7879
- if (global.navigator.userAgent.includes("Android")) {
7881
+ var _a, _b;
7882
+ if (typeof navigator === "undefined") {
7883
+ return false;
7884
+ }
7885
+ if ((_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes("Android")) {
7880
7886
  return false;
7881
7887
  }
7882
- return !!(global.navigator.mediaDevices || {}).getDisplayMedia;
7888
+ return typeof ((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getDisplayMedia) === "function";
7883
7889
  }
7884
7890
  const defaultDisplayMediaConstraints = {
7885
7891
  video: {
package/dist/index.mjs CHANGED
@@ -161,35 +161,37 @@ function rtcStatsConnection(wsURL, logger = console) {
161
161
  clientInfo.connectionNumber++;
162
162
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
163
163
  ws.send(JSON.stringify(["webrtcapihealth", null, getWebRtcApiHealth()]));
164
- if (organizationId) {
165
- ws.send(JSON.stringify(organizationId));
166
- }
167
- if (clientId) {
168
- ws.send(JSON.stringify(clientId));
169
- }
170
- if (roomSessionId) {
171
- ws.send(JSON.stringify(roomSessionId));
172
- }
173
- if (displayName) {
174
- ws.send(JSON.stringify(displayName));
175
- }
176
- if (userRole) {
177
- ws.send(JSON.stringify(userRole));
178
- }
179
- if (deviceId) {
180
- ws.send(JSON.stringify(deviceId));
181
- }
182
- if (roomMode) {
183
- ws.send(JSON.stringify(roomMode));
184
- }
185
- if (roomProduct) {
186
- ws.send(JSON.stringify(roomProduct));
187
- }
188
- if (sfuServer) {
189
- ws.send(JSON.stringify(sfuServer));
190
- }
191
- if (featureFlags) {
192
- ws.send(JSON.stringify(featureFlags));
164
+ if (clientInfo.connectionNumber > 1) {
165
+ if (organizationId) {
166
+ ws.send(JSON.stringify(organizationId));
167
+ }
168
+ if (clientId) {
169
+ ws.send(JSON.stringify(clientId));
170
+ }
171
+ if (roomSessionId) {
172
+ ws.send(JSON.stringify(roomSessionId));
173
+ }
174
+ if (displayName) {
175
+ ws.send(JSON.stringify(displayName));
176
+ }
177
+ if (userRole) {
178
+ ws.send(JSON.stringify(userRole));
179
+ }
180
+ if (deviceId) {
181
+ ws.send(JSON.stringify(deviceId));
182
+ }
183
+ if (roomMode) {
184
+ ws.send(JSON.stringify(roomMode));
185
+ }
186
+ if (roomProduct) {
187
+ ws.send(JSON.stringify(roomProduct));
188
+ }
189
+ if (sfuServer) {
190
+ ws.send(JSON.stringify(sfuServer));
191
+ }
192
+ if (featureFlags) {
193
+ ws.send(JSON.stringify(featureFlags));
194
+ }
193
195
  }
194
196
  while (buffer.length) {
195
197
  ws.send(JSON.stringify(buffer.shift()));
@@ -7856,10 +7858,14 @@ function getStream(constraintOpt_1) {
7856
7858
  });
7857
7859
  }
7858
7860
  function hasGetDisplayMedia() {
7859
- if (global.navigator.userAgent.includes("Android")) {
7861
+ var _a, _b;
7862
+ if (typeof navigator === "undefined") {
7863
+ return false;
7864
+ }
7865
+ if ((_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes("Android")) {
7860
7866
  return false;
7861
7867
  }
7862
- return !!(global.navigator.mediaDevices || {}).getDisplayMedia;
7868
+ return typeof ((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getDisplayMedia) === "function";
7863
7869
  }
7864
7870
  const defaultDisplayMediaConstraints = {
7865
7871
  video: {
@@ -161,35 +161,37 @@ function rtcStatsConnection(wsURL, logger = console) {
161
161
  clientInfo.connectionNumber++;
162
162
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
163
163
  ws.send(JSON.stringify(["webrtcapihealth", null, getWebRtcApiHealth()]));
164
- if (organizationId) {
165
- ws.send(JSON.stringify(organizationId));
166
- }
167
- if (clientId) {
168
- ws.send(JSON.stringify(clientId));
169
- }
170
- if (roomSessionId) {
171
- ws.send(JSON.stringify(roomSessionId));
172
- }
173
- if (displayName) {
174
- ws.send(JSON.stringify(displayName));
175
- }
176
- if (userRole) {
177
- ws.send(JSON.stringify(userRole));
178
- }
179
- if (deviceId) {
180
- ws.send(JSON.stringify(deviceId));
181
- }
182
- if (roomMode) {
183
- ws.send(JSON.stringify(roomMode));
184
- }
185
- if (roomProduct) {
186
- ws.send(JSON.stringify(roomProduct));
187
- }
188
- if (sfuServer) {
189
- ws.send(JSON.stringify(sfuServer));
190
- }
191
- if (featureFlags) {
192
- ws.send(JSON.stringify(featureFlags));
164
+ if (clientInfo.connectionNumber > 1) {
165
+ if (organizationId) {
166
+ ws.send(JSON.stringify(organizationId));
167
+ }
168
+ if (clientId) {
169
+ ws.send(JSON.stringify(clientId));
170
+ }
171
+ if (roomSessionId) {
172
+ ws.send(JSON.stringify(roomSessionId));
173
+ }
174
+ if (displayName) {
175
+ ws.send(JSON.stringify(displayName));
176
+ }
177
+ if (userRole) {
178
+ ws.send(JSON.stringify(userRole));
179
+ }
180
+ if (deviceId) {
181
+ ws.send(JSON.stringify(deviceId));
182
+ }
183
+ if (roomMode) {
184
+ ws.send(JSON.stringify(roomMode));
185
+ }
186
+ if (roomProduct) {
187
+ ws.send(JSON.stringify(roomProduct));
188
+ }
189
+ if (sfuServer) {
190
+ ws.send(JSON.stringify(sfuServer));
191
+ }
192
+ if (featureFlags) {
193
+ ws.send(JSON.stringify(featureFlags));
194
+ }
193
195
  }
194
196
  while (buffer.length) {
195
197
  ws.send(JSON.stringify(buffer.shift()));
@@ -7856,10 +7858,14 @@ function getStream(constraintOpt_1) {
7856
7858
  });
7857
7859
  }
7858
7860
  function hasGetDisplayMedia() {
7859
- if (global.navigator.userAgent.includes("Android")) {
7861
+ var _a, _b;
7862
+ if (typeof navigator === "undefined") {
7863
+ return false;
7864
+ }
7865
+ if ((_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes("Android")) {
7860
7866
  return false;
7861
7867
  }
7862
- return !!(global.navigator.mediaDevices || {}).getDisplayMedia;
7868
+ return typeof ((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getDisplayMedia) === "function";
7863
7869
  }
7864
7870
  const defaultDisplayMediaConstraints = {
7865
7871
  video: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "11.3.1",
4
+ "version": "11.3.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {