@whereby.com/browser-sdk 2.7.0 → 2.8.1

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.
@@ -49,6 +49,9 @@ interface WherebyEmbedElementAttributes extends ReactHTMLElement<HTMLElement> {
49
49
  video: string;
50
50
  virtualBackgroundUrl: string;
51
51
  }
52
+ interface PrecallCheckCompletedStepResult {
53
+ status: "passed" | "failed";
54
+ }
52
55
  interface WherebyEmbedElementEventMap {
53
56
  ready: CustomEvent;
54
57
  knock: CustomEvent;
@@ -96,6 +99,16 @@ interface WherebyEmbedElementEventMap {
96
99
  connection_status_change: CustomEvent<{
97
100
  status: "stable" | "unstable";
98
101
  }>;
102
+ precall_check_skipped: CustomEvent;
103
+ precall_check_completed: CustomEvent<{
104
+ status: "passed" | "failed";
105
+ steps: {
106
+ camera: PrecallCheckCompletedStepResult;
107
+ speaker: PrecallCheckCompletedStepResult;
108
+ microphone: PrecallCheckCompletedStepResult;
109
+ bandwidth: PrecallCheckCompletedStepResult;
110
+ };
111
+ }>;
99
112
  }
100
113
  interface WherebyEmbedElementCommands {
101
114
  startRecording: () => void;
@@ -95,18 +95,19 @@ interface UseRoomConnectionOptions extends Omit<RoomConnectionOptions, "localMed
95
95
  localMedia?: UseLocalMediaResult;
96
96
  }
97
97
  interface RoomConnectionActions {
98
- sendChatMessage(text: string): void;
98
+ acceptWaitingParticipant(participantId: string): void;
99
99
  knock(): void;
100
100
  lockRoom(locked: boolean): void;
101
- setDisplayName(displayName: string): void;
102
- toggleCamera(enabled?: boolean): void;
103
- toggleMicrophone(enabled?: boolean): void;
104
- acceptWaitingParticipant(participantId: string): void;
101
+ muteParticipants(clientIds: string[]): void;
105
102
  rejectWaitingParticipant(participantId: string): void;
103
+ sendChatMessage(text: string): void;
104
+ setDisplayName(displayName: string): void;
106
105
  startCloudRecording(): void;
107
106
  startScreenshare(): void;
108
107
  stopCloudRecording(): void;
109
108
  stopScreenshare(): void;
109
+ toggleCamera(enabled?: boolean): void;
110
+ toggleMicrophone(enabled?: boolean): void;
110
111
  }
111
112
 
112
113
  type VideoViewComponentProps = Omit<React.ComponentProps<typeof _default>, "onResize">;
@@ -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, 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, 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';
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.7.0";
102
+ const browserSdkVersion = "2.8.1";
103
103
 
104
104
  const initialState$1 = {
105
105
  chatMessages: [],
@@ -171,21 +171,25 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
171
171
  const stopCloudRecording = React.useCallback(() => store.dispatch(doStopCloudRecording()), [store]);
172
172
  const stopScreenshare = React.useCallback(() => store.dispatch(doStopScreenshare()), [store]);
173
173
  const lockRoom = React.useCallback((locked) => store.dispatch(doLockRoom({ locked })), [store]);
174
+ const muteParticipants = React.useCallback((clientIds) => {
175
+ store.dispatch(doRequestAudioEnable({ clientIds, enable: false }));
176
+ }, [store]);
174
177
  return {
175
178
  state: roomConnectionState,
176
179
  actions: {
177
- sendChatMessage,
180
+ acceptWaitingParticipant,
178
181
  knock,
179
182
  lockRoom,
180
- setDisplayName,
181
- toggleCamera,
182
- toggleMicrophone,
183
- acceptWaitingParticipant,
183
+ muteParticipants,
184
184
  rejectWaitingParticipant,
185
+ sendChatMessage,
186
+ setDisplayName,
185
187
  startCloudRecording,
186
188
  startScreenshare,
187
189
  stopCloudRecording,
188
190
  stopScreenshare,
191
+ toggleCamera,
192
+ toggleMicrophone,
189
193
  },
190
194
  components: {
191
195
  VideoView: boundVideoView || VideoView,
package/package.json CHANGED
@@ -1,106 +1,98 @@
1
1
  {
2
- "name": "@whereby.com/browser-sdk",
3
- "version": "2.7.0",
4
- "description": "Modules for integration Whereby video in web apps",
5
- "author": "Whereby AS",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/whereby/sdk.git",
10
- "directory": "packages/browser-sdk"
2
+ "name": "@whereby.com/browser-sdk",
3
+ "version": "2.8.1",
4
+ "description": "Modules for integration Whereby video in web apps",
5
+ "author": "Whereby AS",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/whereby/sdk.git",
10
+ "directory": "packages/browser-sdk"
11
+ },
12
+ "browserslist": "> 0.5%, last 2 versions, not dead",
13
+ "source": "src/index.js",
14
+ "exports": {
15
+ "./react": {
16
+ "import": "./dist/react/index.esm.js",
17
+ "types": "./dist/react/index.d.ts"
11
18
  },
12
- "browserslist": "> 0.5%, last 2 versions, not dead",
13
- "source": "src/index.js",
14
- "exports": {
15
- "./react": {
16
- "import": "./dist/react/index.esm.js",
17
- "types": "./dist/react/index.d.ts"
18
- },
19
- "./embed": {
20
- "import": "./dist/embed/index.esm.js",
21
- "types": "./dist/embed/index.d.ts"
22
- }
23
- },
24
- "typesVersions": {
25
- "*": {
26
- "react": [
27
- "dist/react/index.d.ts"
28
- ],
29
- "embed": [
30
- "dist/embed/index.d.ts"
31
- ]
32
- }
33
- },
34
- "files": [
35
- "dist/**/*.js",
36
- "dist/**/*.d.ts"
37
- ],
38
- "scripts": {
39
- "prebuild": "rimraf dist",
40
- "build": "rollup -c rollup.config.js",
41
- "build:storybook": "storybook build",
42
- "dev": "storybook dev -p 6006",
43
- "test": "yarn test:lint && yarn test:unit",
44
- "test:lint": "eslint src/",
45
- "test:unit": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
46
- "test:unit:watch": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --watch",
47
- "test:attw": "attw --pack . -f table --ignore-rules fallback-condition unexpected-module-syntax",
48
- "storybook": "storybook dev -p 6006",
49
- "build-storybook": "storybook build"
50
- },
51
- "devDependencies": {
52
- "@babel/core": "^7.18.5",
53
- "@babel/plugin-proposal-optional-chaining": "^7.18.9",
54
- "@babel/preset-env": "^7.23.2",
55
- "@babel/preset-react": "^7.22.15",
56
- "@babel/preset-typescript": "^7.23.2",
57
- "@rollup/plugin-commonjs": "^25.0.7",
58
- "@rollup/plugin-json": "^6.0.1",
59
- "@rollup/plugin-node-resolve": "^15.2.3",
60
- "@rollup/plugin-replace": "^5.0.5",
61
- "@storybook/addon-actions": "^7.5.2",
62
- "@storybook/addon-essentials": "^7.6.13",
63
- "@storybook/addon-links": "^7.6.16",
64
- "@storybook/react": "^7.5.2",
65
- "@storybook/react-webpack5": "^7.6.16",
66
- "@testing-library/react": "^14.0.0",
67
- "@types/chrome": "^0.0.210",
68
- "@types/node": "^20.11.19",
69
- "@types/react": "^18.2.57",
70
- "@types/uuid": "^9.0.7",
71
- "babel-loader": "^8.2.5",
72
- "deep-object-diff": "^1.1.9",
73
- "dotenv": "^16.4.5",
74
- "dotenv-run-script": "^0.4.1",
75
- "lit-html": "^2.5.0",
76
- "react": "^18.2.0",
77
- "react-dom": "^18.2.0",
78
- "rimraf": "^5.0.5",
79
- "rollup": "^4.12.0",
80
- "rollup-plugin-dts": "^6.1.0",
81
- "rollup-plugin-polyfill-node": "^0.13.0",
82
- "rollup-plugin-terser": "^7.0.2",
83
- "rollup-plugin-typescript2": "^0.36.0",
84
- "storybook": "^8.0.5",
85
- "tslib": "^2.4.1",
86
- "uuid": "^9.0.1",
87
- "yalc": "^1.0.0-pre.53"
88
- },
89
- "dependencies": {
90
- "@reduxjs/toolkit": "^2.2.3",
91
- "@whereby.com/core": "*",
92
- "heresy": "^1.0.4"
93
- },
94
- "peerDependencies": {
95
- "react": "^18.2.0",
96
- "react-dom": "^18.2.0"
97
- },
98
- "resolutions": {
99
- "string-width": "^4",
100
- "jackspeak": "2.1.1",
101
- "wrap-ansi": "7.0.0"
102
- },
103
- "publishConfig": {
104
- "access": "public"
19
+ "./embed": {
20
+ "import": "./dist/embed/index.esm.js",
21
+ "types": "./dist/embed/index.d.ts"
22
+ }
23
+ },
24
+ "typesVersions": {
25
+ "*": {
26
+ "react": [
27
+ "dist/react/index.d.ts"
28
+ ],
29
+ "embed": [
30
+ "dist/embed/index.d.ts"
31
+ ]
105
32
  }
33
+ },
34
+ "files": [
35
+ "dist/**/*.js",
36
+ "dist/**/*.d.ts"
37
+ ],
38
+ "scripts": {
39
+ "prebuild": "rimraf dist",
40
+ "build": "rollup -c rollup.config.js",
41
+ "build:storybook": "storybook build",
42
+ "dev": "storybook dev -p 6006",
43
+ "test": "yarn test:lint && yarn test:unit",
44
+ "test:lint": "eslint src/",
45
+ "test:unit": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
46
+ "test:unit:watch": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --watch",
47
+ "test:attw": "attw --pack . -f table --ignore-rules fallback-condition unexpected-module-syntax",
48
+ "storybook": "storybook dev -p 6006",
49
+ "build-storybook": "storybook build"
50
+ },
51
+ "devDependencies": {
52
+ "@babel/core": "^7.18.5",
53
+ "@babel/plugin-proposal-optional-chaining": "^7.18.9",
54
+ "@babel/preset-env": "^7.23.2",
55
+ "@babel/preset-react": "^7.22.15",
56
+ "@babel/preset-typescript": "^7.23.2",
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",
63
+ "@testing-library/react": "^14.0.0",
64
+ "@types/chrome": "^0.0.210",
65
+ "@types/node": "^20.11.19",
66
+ "@types/react": "^18.2.57",
67
+ "@types/uuid": "^9.0.7",
68
+ "babel-loader": "^8.2.5",
69
+ "deep-object-diff": "^1.1.9",
70
+ "dotenv": "^16.4.5",
71
+ "dotenv-run-script": "^0.4.1",
72
+ "lit-html": "^2.5.0",
73
+ "react": "^18.2.0",
74
+ "react-dom": "^18.2.0",
75
+ "rimraf": "^5.0.5",
76
+ "storybook": "^8.0.6",
77
+ "tslib": "^2.4.1",
78
+ "uuid": "^9.0.1",
79
+ "yalc": "^1.0.0-pre.53"
80
+ },
81
+ "dependencies": {
82
+ "@reduxjs/toolkit": "^2.2.3",
83
+ "@whereby.com/core": "*",
84
+ "heresy": "^1.0.4"
85
+ },
86
+ "peerDependencies": {
87
+ "react": "^18.2.0",
88
+ "react-dom": "^18.2.0"
89
+ },
90
+ "resolutions": {
91
+ "string-width": "^4",
92
+ "jackspeak": "2.1.1",
93
+ "wrap-ansi": "7.0.0"
94
+ },
95
+ "publishConfig": {
96
+ "access": "public"
97
+ }
106
98
  }