@whereby.com/browser-sdk 3.34.2 → 3.36.0

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  var React = require('react');
4
4
  var core = require('@whereby.com/core');
5
+ var adapterRaw = require('webrtc-adapter');
5
6
  var runes = require('runes');
6
7
  var PopoverPrimitive = require('@radix-ui/react-popover');
7
8
 
@@ -80,6 +81,9 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
80
81
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
81
82
  };
82
83
 
84
+ var _a, _b;
85
+ const adapter = (_a = adapterRaw.default) !== null && _a !== void 0 ? _a : adapterRaw;
86
+ const isSafari = ((_b = adapter.browserDetails) === null || _b === void 0 ? void 0 : _b.browser) === "safari";
83
87
  const useAudioElement = ({ stream, muted }) => {
84
88
  var _a, _b;
85
89
  const audioEl = React__namespace.useRef(null);
@@ -101,6 +105,11 @@ const useAudioElement = ({ stream, muted }) => {
101
105
  if (audioEl.current.srcObject !== stream) {
102
106
  audioEl.current.srcObject = stream;
103
107
  }
108
+ if (isSafari) {
109
+ audioEl.current.play().catch((err) => {
110
+ console.warn(`Failed to start audio playback: ${err}`);
111
+ });
112
+ }
104
113
  if (audioEl.current.setSinkId) {
105
114
  audioEl.current.setSinkId(currentSpeakerId).catch((err) => {
106
115
  console.warn(`Failed to set audio output device: ${err}`);
@@ -172,7 +181,7 @@ const VideoView = React__namespace.forwardRef((_a, ref) => {
172
181
  });
173
182
  VideoView.displayName = "VideoView";
174
183
 
175
- const browserSdkVersion = "3.34.2";
184
+ const browserSdkVersion = "3.36.0";
176
185
 
177
186
  const initialState$1 = {
178
187
  chatMessages: [],
@@ -199,6 +208,7 @@ const initialState$1 = {
199
208
  participantsInCurrentGroup: [],
200
209
  broadcastingParticipants: [],
201
210
  },
211
+ remoteParticipantQualityReport: {},
202
212
  isAudioOnlyModeEnabled: false,
203
213
  isCameraEnabled: false,
204
214
  isMicrophoneEnabled: false,
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as _whereby_com_core from '@whereby.com/core';
3
3
  import { LocalMediaState, LocalMediaOptions, InitialMuteStates, RoomJoinedSuccess, SendFilesOptions, ChatFileShare, ToggleAudioOnlyModeOptions, RoomIntegrationProps, StartBreakoutSessionOptions, UpdateBreakoutSessionOptions, RoomConnectionState, NotificationsEventEmitter, ClientView, RoomIntegrationSessionView, RoomIntegration, RoomIntegrationPickerResult } from '@whereby.com/core';
4
- export { ACCEPTED_FILE_TYPES, BreakoutState as Breakout, ChatFileShare, ChatMessageState as ChatMessage, CloudRecordingState as CloudRecording, FileShareError, FileUpload, KnockResponse, LiveStreamState as LiveStreaming, LocalParticipantState as LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, RemoteParticipantState as RemoteParticipant, RoomConnectionState as RoomConnection, RoomIntegration, RoomIntegrationContent, RoomIntegrationError, RoomIntegrationErrorDetail, RoomIntegrationPickerResult, RoomIntegrationProps, RoomIntegrationSession, RoomIntegrationSessionView, RoomIntegrationsState as RoomIntegrations, ScreenshareState as Screenshare, SendFilesOptions, ToggleAudioOnlyModeOptions, WaitingParticipantState as WaitingParticipant, YouTubeContentMetadata, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
4
+ export { ACCEPTED_FILE_TYPES, BreakoutState as Breakout, CallQualityLevel, ChatFileShare, ChatMessageState as ChatMessage, CloudRecordingState as CloudRecording, FileShareError, FileUpload, KnockResponse, LiveStreamState as LiveStreaming, LocalParticipantState as LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, RemoteParticipantState as RemoteParticipant, RemoteParticipantQualityReport, RoomConnectionState as RoomConnection, RoomIntegration, RoomIntegrationContent, RoomIntegrationError, RoomIntegrationErrorDetail, RoomIntegrationPickerResult, RoomIntegrationProps, RoomIntegrationSession, RoomIntegrationSessionView, RoomIntegrationsState as RoomIntegrations, ScreenshareState as Screenshare, SendFilesOptions, ToggleAudioOnlyModeOptions, WaitingParticipantState as WaitingParticipant, YouTubeContentMetadata, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
5
5
  import * as _radix_ui_react_popover from '@radix-ui/react-popover';
6
6
  import { PopoverProps } from '@radix-ui/react-popover';
7
7
 
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { WherebyClient, CURRENT_SPEAKER_CHANGED, debounce, ROOM_INTEGRATION_PICKER_MESSAGES, roomIntegrationPickerUrl } from '@whereby.com/core';
3
3
  export { ACCEPTED_FILE_TYPES, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
4
+ import adapterRaw from 'webrtc-adapter';
4
5
  import runes from 'runes';
5
6
  import * as PopoverPrimitive from '@radix-ui/react-popover';
6
7
 
@@ -59,6 +60,9 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
59
60
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
60
61
  };
61
62
 
63
+ var _a, _b;
64
+ const adapter = (_a = adapterRaw.default) !== null && _a !== void 0 ? _a : adapterRaw;
65
+ const isSafari = ((_b = adapter.browserDetails) === null || _b === void 0 ? void 0 : _b.browser) === "safari";
62
66
  const useAudioElement = ({ stream, muted }) => {
63
67
  var _a, _b;
64
68
  const audioEl = React.useRef(null);
@@ -80,6 +84,11 @@ const useAudioElement = ({ stream, muted }) => {
80
84
  if (audioEl.current.srcObject !== stream) {
81
85
  audioEl.current.srcObject = stream;
82
86
  }
87
+ if (isSafari) {
88
+ audioEl.current.play().catch((err) => {
89
+ console.warn(`Failed to start audio playback: ${err}`);
90
+ });
91
+ }
83
92
  if (audioEl.current.setSinkId) {
84
93
  audioEl.current.setSinkId(currentSpeakerId).catch((err) => {
85
94
  console.warn(`Failed to set audio output device: ${err}`);
@@ -151,7 +160,7 @@ const VideoView = React.forwardRef((_a, ref) => {
151
160
  });
152
161
  VideoView.displayName = "VideoView";
153
162
 
154
- const browserSdkVersion = "3.34.2";
163
+ const browserSdkVersion = "3.36.0";
155
164
 
156
165
  const initialState$1 = {
157
166
  chatMessages: [],
@@ -178,6 +187,7 @@ const initialState$1 = {
178
187
  participantsInCurrentGroup: [],
179
188
  broadcastingParticipants: [],
180
189
  },
190
+ remoteParticipantQualityReport: {},
181
191
  isAudioOnlyModeEnabled: false,
182
192
  isCameraEnabled: false,
183
193
  isMicrophoneEnabled: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whereby.com/browser-sdk",
3
- "version": "3.34.2",
3
+ "version": "3.36.0",
4
4
  "description": "Modules for integration Whereby video in web apps",
5
5
  "author": "Whereby AS",
6
6
  "license": "MIT",
@@ -73,11 +73,12 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@radix-ui/react-popover": "^1.0.7",
76
- "@whereby.com/media": "11.3.0",
77
- "@whereby.com/core": "1.24.0",
76
+ "@whereby.com/media": "11.3.1",
77
+ "@whereby.com/core": "1.26.0",
78
78
  "clsx": "^2.1.1",
79
79
  "heresy": "^1.0.4",
80
- "runes": "^0.4.3"
80
+ "runes": "^0.4.3",
81
+ "webrtc-adapter": "9.0.4"
81
82
  },
82
83
  "peerDependencies": {
83
84
  "react": ">=18.2.0",