@whereby.com/media 9.2.2 → 9.2.4

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
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var webrtcapihealthcheck = require('@whereby.com/webrtcapihealthcheck');
3
4
  var adapterRaw = require('webrtc-adapter');
4
5
  var rtcstats = require('@whereby.com/rtcstats');
5
6
  var uuid = require('uuid');
@@ -179,6 +180,7 @@ function rtcStatsConnection(wsURL, logger = console) {
179
180
  ws.onopen = () => {
180
181
  clientInfo.connectionNumber++;
181
182
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
183
+ ws.send(JSON.stringify(["webrtcapihealth", null, webrtcapihealthcheck.getWebRtcApiHealth()]));
182
184
  if (organizationId) {
183
185
  ws.send(JSON.stringify(organizationId));
184
186
  }
@@ -2473,9 +2475,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
2473
2475
  function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
2474
2476
  const audioDevices = devices.filter((d) => d.kind === "audioinput");
2475
2477
  const videoDevices = devices.filter((d) => d.kind === "videoinput");
2478
+ const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
2479
+ const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
2476
2480
  const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
2477
- audioId: typeof audioId === "string" ? { [type]: audioId } : null,
2478
- videoId: typeof videoId === "string" ? { [type]: videoId } : null,
2481
+ audioId: useDefaultAudio ? null : { [type]: audioId },
2482
+ videoId: useDefaultVideo ? null : { [type]: videoId },
2479
2483
  } }, options));
2480
2484
  if (audioId === false || !audioDevices.length) {
2481
2485
  delete constraints.audio;
@@ -7415,6 +7419,10 @@ exports.RtcEventNames = void 0;
7415
7419
  RtcEventNames["stream_added"] = "stream_added";
7416
7420
  })(exports.RtcEventNames || (exports.RtcEventNames = {}));
7417
7421
 
7422
+ Object.defineProperty(exports, "getWebRtcApiHealth", {
7423
+ enumerable: true,
7424
+ get: function () { return webrtcapihealthcheck.getWebRtcApiHealth; }
7425
+ });
7418
7426
  exports.ADDITIONAL_SCREEN_SHARE_SETTINGS = ADDITIONAL_SCREEN_SHARE_SETTINGS;
7419
7427
  exports.AUDIO_SETTINGS = AUDIO_SETTINGS;
7420
7428
  exports.BandwidthTester = BandwidthTester;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ export { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
1
2
  import { Device } from 'mediasoup-client';
2
3
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
3
4
  import { RtpCapabilities } from 'mediasoup-client/lib/RtpParameters';
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ export { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
1
2
  import { Device } from 'mediasoup-client';
2
3
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
3
4
  import { RtpCapabilities } from 'mediasoup-client/lib/RtpParameters';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
1
2
  import { Device } from 'mediasoup-client';
2
3
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
3
4
  import { RtpCapabilities } from 'mediasoup-client/lib/RtpParameters';
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
2
+ export { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
1
3
  import adapterRaw from 'webrtc-adapter';
2
4
  import rtcstats from '@whereby.com/rtcstats';
3
5
  import { v4 as v4$1 } from 'uuid';
@@ -158,6 +160,7 @@ function rtcStatsConnection(wsURL, logger = console) {
158
160
  ws.onopen = () => {
159
161
  clientInfo.connectionNumber++;
160
162
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
163
+ ws.send(JSON.stringify(["webrtcapihealth", null, getWebRtcApiHealth()]));
161
164
  if (organizationId) {
162
165
  ws.send(JSON.stringify(organizationId));
163
166
  }
@@ -2452,9 +2455,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
2452
2455
  function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
2453
2456
  const audioDevices = devices.filter((d) => d.kind === "audioinput");
2454
2457
  const videoDevices = devices.filter((d) => d.kind === "videoinput");
2458
+ const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
2459
+ const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
2455
2460
  const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
2456
- audioId: typeof audioId === "string" ? { [type]: audioId } : null,
2457
- videoId: typeof videoId === "string" ? { [type]: videoId } : null,
2461
+ audioId: useDefaultAudio ? null : { [type]: audioId },
2462
+ videoId: useDefaultVideo ? null : { [type]: videoId },
2458
2463
  } }, options));
2459
2464
  if (audioId === false || !audioDevices.length) {
2460
2465
  delete constraints.audio;
@@ -1,3 +1,5 @@
1
+ import { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
2
+ export { getWebRtcApiHealth } from '@whereby.com/webrtcapihealthcheck';
1
3
  import adapterRaw from 'webrtc-adapter';
2
4
  import rtcstats from '@whereby.com/rtcstats';
3
5
  import { v4 as v4$1 } from 'uuid';
@@ -158,6 +160,7 @@ function rtcStatsConnection(wsURL, logger = console) {
158
160
  ws.onopen = () => {
159
161
  clientInfo.connectionNumber++;
160
162
  ws.send(JSON.stringify(["clientInfo", null, clientInfo]));
163
+ ws.send(JSON.stringify(["webrtcapihealth", null, getWebRtcApiHealth()]));
161
164
  if (organizationId) {
162
165
  ws.send(JSON.stringify(organizationId));
163
166
  }
@@ -2452,9 +2455,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
2452
2455
  function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
2453
2456
  const audioDevices = devices.filter((d) => d.kind === "audioinput");
2454
2457
  const videoDevices = devices.filter((d) => d.kind === "videoinput");
2458
+ const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
2459
+ const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
2455
2460
  const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
2456
- audioId: typeof audioId === "string" ? { [type]: audioId } : null,
2457
- videoId: typeof videoId === "string" ? { [type]: videoId } : null,
2461
+ audioId: useDefaultAudio ? null : { [type]: audioId },
2462
+ videoId: useDefaultVideo ? null : { [type]: videoId },
2458
2463
  } }, options));
2459
2464
  if (audioId === false || !audioDevices.length) {
2460
2465
  delete constraints.audio;
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": "9.2.2",
4
+ "version": "9.2.4",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {
@@ -43,6 +43,7 @@
43
43
  "ip-address": "^10.1.1",
44
44
  "mediasoup-client": "3.19.0",
45
45
  "@whereby.com/rtcstats": "5.4.2",
46
+ "@whereby.com/webrtcapihealthcheck": "1.0.1",
46
47
  "sdp": "^3.2.0",
47
48
  "sdp-transform": "^2.14.2",
48
49
  "socket.io-client": "4.7.2",
@@ -61,11 +62,11 @@
61
62
  "prettier": "^3.5.3",
62
63
  "process": "^0.11.10",
63
64
  "typescript": "^5.8.3",
64
- "@whereby.com/eslint-config": "0.1.0",
65
65
  "@whereby.com/jest-config": "0.1.0",
66
+ "@whereby.com/eslint-config": "0.1.0",
66
67
  "@whereby.com/prettier-config": "0.1.0",
67
- "@whereby.com/rollup-config": "0.1.1",
68
- "@whereby.com/tsconfig": "0.1.0"
68
+ "@whereby.com/tsconfig": "0.1.0",
69
+ "@whereby.com/rollup-config": "0.1.1"
69
70
  },
70
71
  "engines": {
71
72
  "node": ">=24.0.0"