@whereby.com/browser-sdk 2.8.1 → 2.10.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.
- package/dist/cdn/v2-embed.js +6 -6
- package/dist/cdn/v2-react.js +2 -2
- package/dist/embed/index.d.ts +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.esm.js +10 -2
- package/package.json +10 -15
package/dist/embed/index.d.ts
CHANGED
package/dist/react/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ interface LocalMediaActions {
|
|
|
38
38
|
setMicrophoneDevice: (deviceId: string) => void;
|
|
39
39
|
toggleCameraEnabled: (enabled?: boolean) => void;
|
|
40
40
|
toggleMicrophoneEnabled: (enabled?: boolean) => void;
|
|
41
|
+
toggleLowDataModeEnabled: (enabled?: boolean) => void;
|
|
41
42
|
}
|
|
42
43
|
type UseLocalMediaResult = {
|
|
43
44
|
state: LocalMediaState;
|
|
@@ -95,10 +96,13 @@ interface UseRoomConnectionOptions extends Omit<RoomConnectionOptions, "localMed
|
|
|
95
96
|
localMedia?: UseLocalMediaResult;
|
|
96
97
|
}
|
|
97
98
|
interface RoomConnectionActions {
|
|
99
|
+
toggleLowDataMode(enabled?: boolean): void;
|
|
98
100
|
acceptWaitingParticipant(participantId: string): void;
|
|
99
101
|
knock(): void;
|
|
100
102
|
lockRoom(locked: boolean): void;
|
|
101
103
|
muteParticipants(clientIds: string[]): void;
|
|
104
|
+
kickParticipant(clientId: string): void;
|
|
105
|
+
endMeeting(): void;
|
|
102
106
|
rejectWaitingParticipant(participantId: string): void;
|
|
103
107
|
sendChatMessage(text: string): void;
|
|
104
108
|
setDisplayName(displayName: string): void;
|
package/dist/react/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
-
import { debounce, selectChatMessages, selectCloudRecordingRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, createServices, createStore, observeStore, doAppJoin, appLeft, doRtcReportStreamResolution, doSendChatMessage, doKnockRoom, doSetDisplayName, toggleCameraEnabled, toggleMicrophoneEnabled, doAcceptWaitingParticipant, doRejectWaitingParticipant, doStartCloudRecording, doStartScreenshare, doStopCloudRecording, doStopScreenshare, doLockRoom, doRequestAudioEnable, selectCameraDeviceError, selectCameraDevices, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectIsSettingCameraDevice, selectIsSettingMicrophoneDevice, selectIsLocalMediaStarting, selectMicrophoneDeviceError, selectMicrophoneDevices, selectSpeakerDevices, selectLocalMediaStartError, doStartLocalMedia, doStopLocalMedia, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId } from '@whereby.com/core';
|
|
3
|
+
import { debounce, selectChatMessages, selectCloudRecordingRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, createServices, createStore, observeStore, doAppJoin, appLeft, doRtcReportStreamResolution, doSendChatMessage, doKnockRoom, doSetDisplayName, toggleCameraEnabled, toggleMicrophoneEnabled, toggleLowDataModeEnabled, doAcceptWaitingParticipant, doRejectWaitingParticipant, doStartCloudRecording, doStartScreenshare, doStopCloudRecording, doStopScreenshare, doLockRoom, doRequestAudioEnable, doKickParticipant, doEndMeeting, selectCameraDeviceError, selectCameraDevices, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectIsSettingCameraDevice, selectIsSettingMicrophoneDevice, selectIsLocalMediaStarting, selectMicrophoneDeviceError, selectMicrophoneDevices, selectSpeakerDevices, selectLocalMediaStartError, doStartLocalMedia, doStopLocalMedia, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId } from '@whereby.com/core';
|
|
4
4
|
import { createSelector } from '@reduxjs/toolkit';
|
|
5
5
|
|
|
6
6
|
/******************************************************************************
|
|
@@ -99,7 +99,7 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloud
|
|
|
99
99
|
return state;
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
const browserSdkVersion = "2.
|
|
102
|
+
const browserSdkVersion = "2.10.0";
|
|
103
103
|
|
|
104
104
|
const initialState$1 = {
|
|
105
105
|
chatMessages: [],
|
|
@@ -164,6 +164,7 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
|
|
|
164
164
|
const setDisplayName = React.useCallback((displayName) => store.dispatch(doSetDisplayName({ displayName })), [store]);
|
|
165
165
|
const toggleCamera = React.useCallback((enabled) => store.dispatch(toggleCameraEnabled({ enabled })), [store]);
|
|
166
166
|
const toggleMicrophone = React.useCallback((enabled) => store.dispatch(toggleMicrophoneEnabled({ enabled })), [store]);
|
|
167
|
+
const toggleLowDataMode = React.useCallback((enabled) => store.dispatch(toggleLowDataModeEnabled({ enabled })), [store]);
|
|
167
168
|
const acceptWaitingParticipant = React.useCallback((participantId) => store.dispatch(doAcceptWaitingParticipant({ participantId })), [store]);
|
|
168
169
|
const rejectWaitingParticipant = React.useCallback((participantId) => store.dispatch(doRejectWaitingParticipant({ participantId })), [store]);
|
|
169
170
|
const startCloudRecording = React.useCallback(() => store.dispatch(doStartCloudRecording()), [store]);
|
|
@@ -174,13 +175,18 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
|
|
|
174
175
|
const muteParticipants = React.useCallback((clientIds) => {
|
|
175
176
|
store.dispatch(doRequestAudioEnable({ clientIds, enable: false }));
|
|
176
177
|
}, [store]);
|
|
178
|
+
const kickParticipant = React.useCallback((clientId) => store.dispatch(doKickParticipant({ clientId })), [store]);
|
|
179
|
+
const endMeeting = React.useCallback(() => store.dispatch(doEndMeeting()), [store]);
|
|
177
180
|
return {
|
|
178
181
|
state: roomConnectionState,
|
|
179
182
|
actions: {
|
|
183
|
+
toggleLowDataMode,
|
|
180
184
|
acceptWaitingParticipant,
|
|
181
185
|
knock,
|
|
182
186
|
lockRoom,
|
|
183
187
|
muteParticipants,
|
|
188
|
+
kickParticipant,
|
|
189
|
+
endMeeting,
|
|
184
190
|
rejectWaitingParticipant,
|
|
185
191
|
sendChatMessage,
|
|
186
192
|
setDisplayName,
|
|
@@ -245,6 +251,7 @@ function useLocalMedia(optionsOrStream = { audio: true, video: true }) {
|
|
|
245
251
|
const setMicrophoneDevice = useCallback((deviceId) => store.dispatch(setCurrentMicrophoneDeviceId({ deviceId })), [store]);
|
|
246
252
|
const toggleCamera = useCallback((enabled) => store.dispatch(toggleCameraEnabled({ enabled })), [store]);
|
|
247
253
|
const toggleMicrophone = useCallback((enabled) => store.dispatch(toggleMicrophoneEnabled({ enabled })), [store]);
|
|
254
|
+
const toggleLowDataMode = useCallback((enabled) => store.dispatch(toggleLowDataModeEnabled({ enabled })), [store]);
|
|
248
255
|
return {
|
|
249
256
|
state: localMediaState,
|
|
250
257
|
actions: {
|
|
@@ -252,6 +259,7 @@ function useLocalMedia(optionsOrStream = { audio: true, video: true }) {
|
|
|
252
259
|
setMicrophoneDevice,
|
|
253
260
|
toggleCameraEnabled: toggleCamera,
|
|
254
261
|
toggleMicrophoneEnabled: toggleMicrophone,
|
|
262
|
+
toggleLowDataModeEnabled: toggleLowDataMode,
|
|
255
263
|
},
|
|
256
264
|
store,
|
|
257
265
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whereby.com/browser-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Modules for integration Whereby video in web apps",
|
|
5
5
|
"author": "Whereby AS",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,23 +49,17 @@
|
|
|
49
49
|
"build-storybook": "storybook build"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@storybook/addon-actions": "^8.0.6",
|
|
58
|
-
"@storybook/addon-essentials": "^8.0.6",
|
|
59
|
-
"@storybook/addon-links": "^8.0.6",
|
|
60
|
-
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
|
|
61
|
-
"@storybook/react": "^8.0.6",
|
|
62
|
-
"@storybook/react-webpack5": "^8.0.6",
|
|
52
|
+
"@storybook/addon-actions": "^8.0.8",
|
|
53
|
+
"@storybook/addon-essentials": "^8.0.8",
|
|
54
|
+
"@storybook/addon-links": "^8.0.8",
|
|
55
|
+
"@storybook/builder-vite": "^8.0.8",
|
|
56
|
+
"@storybook/react-vite": "^8.0.8",
|
|
63
57
|
"@testing-library/react": "^14.0.0",
|
|
64
58
|
"@types/chrome": "^0.0.210",
|
|
65
59
|
"@types/node": "^20.11.19",
|
|
66
60
|
"@types/react": "^18.2.57",
|
|
67
61
|
"@types/uuid": "^9.0.7",
|
|
68
|
-
"
|
|
62
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
69
63
|
"deep-object-diff": "^1.1.9",
|
|
70
64
|
"dotenv": "^16.4.5",
|
|
71
65
|
"dotenv-run-script": "^0.4.1",
|
|
@@ -73,14 +67,15 @@
|
|
|
73
67
|
"react": "^18.2.0",
|
|
74
68
|
"react-dom": "^18.2.0",
|
|
75
69
|
"rimraf": "^5.0.5",
|
|
76
|
-
"storybook": "^8.0.
|
|
70
|
+
"storybook": "^8.0.8",
|
|
77
71
|
"tslib": "^2.4.1",
|
|
78
72
|
"uuid": "^9.0.1",
|
|
73
|
+
"vite": "^5.0.13",
|
|
79
74
|
"yalc": "^1.0.0-pre.53"
|
|
80
75
|
},
|
|
81
76
|
"dependencies": {
|
|
82
77
|
"@reduxjs/toolkit": "^2.2.3",
|
|
83
|
-
"@whereby.com/core": "
|
|
78
|
+
"@whereby.com/core": "0.13.0",
|
|
84
79
|
"heresy": "^1.0.4"
|
|
85
80
|
},
|
|
86
81
|
"peerDependencies": {
|