@whereby.com/browser-sdk 2.10.1 → 2.12.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 +7 -7
- package/dist/cdn/v2-react.js +2 -2
- package/dist/embed/index.d.ts +5 -0
- package/dist/embed/index.esm.js +24 -17
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.esm.js +11 -6
- package/package.json +2 -2
package/dist/embed/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface WherebyEmbedElementAttributes extends ReactHTMLElement<HTMLElement> {
|
|
|
12
12
|
bottomToolbar: string;
|
|
13
13
|
breakout: string;
|
|
14
14
|
cameraAccess: string;
|
|
15
|
+
cameraEffect: string;
|
|
15
16
|
chat: string;
|
|
16
17
|
displayName: string;
|
|
17
18
|
emptyRoomInvitation: string;
|
|
@@ -22,6 +23,7 @@ interface WherebyEmbedElementAttributes extends ReactHTMLElement<HTMLElement> {
|
|
|
22
23
|
lang: string;
|
|
23
24
|
leaveButton: string;
|
|
24
25
|
locking: string;
|
|
26
|
+
localization: string;
|
|
25
27
|
logo: string;
|
|
26
28
|
lowData: string;
|
|
27
29
|
metadata: string;
|
|
@@ -46,6 +48,8 @@ interface WherebyEmbedElementAttributes extends ReactHTMLElement<HTMLElement> {
|
|
|
46
48
|
subgridLabels: string;
|
|
47
49
|
timer: string;
|
|
48
50
|
title: string;
|
|
51
|
+
toolbarDarkText: string;
|
|
52
|
+
topToolbar: string;
|
|
49
53
|
video: string;
|
|
50
54
|
virtualBackgroundUrl: string;
|
|
51
55
|
}
|
|
@@ -112,6 +116,7 @@ interface WherebyEmbedElementEventMap {
|
|
|
112
116
|
}>;
|
|
113
117
|
}
|
|
114
118
|
interface WherebyEmbedElementCommands {
|
|
119
|
+
endMeeting: () => void;
|
|
115
120
|
startRecording: () => void;
|
|
116
121
|
stopRecording: () => void;
|
|
117
122
|
startStreaming: () => void;
|
package/dist/embed/index.esm.js
CHANGED
|
@@ -10,34 +10,37 @@ const boolAttrs = [
|
|
|
10
10
|
"autoSpotlight",
|
|
11
11
|
"background",
|
|
12
12
|
"bottomToolbar",
|
|
13
|
+
"breakout",
|
|
13
14
|
"cameraAccess",
|
|
14
15
|
"chat",
|
|
15
|
-
"people",
|
|
16
16
|
"embed",
|
|
17
17
|
"emptyRoomInvitation",
|
|
18
|
+
"floatSelf",
|
|
18
19
|
"help",
|
|
19
20
|
"leaveButton",
|
|
20
|
-
"precallCeremony",
|
|
21
|
-
"precallReview",
|
|
22
|
-
"screenshare",
|
|
23
|
-
"video",
|
|
24
|
-
"floatSelf",
|
|
25
|
-
"recording",
|
|
26
|
-
"logo",
|
|
27
21
|
"locking",
|
|
28
|
-
"
|
|
22
|
+
"localization",
|
|
23
|
+
"logo",
|
|
24
|
+
"lowData",
|
|
25
|
+
"moreButton",
|
|
29
26
|
"participantCount",
|
|
27
|
+
"personality",
|
|
28
|
+
"pipButton",
|
|
29
|
+
"precallCeremony",
|
|
30
|
+
"precallCeremonyCanSkip",
|
|
30
31
|
"precallPermissionsHelpLink",
|
|
32
|
+
"precallReview",
|
|
33
|
+
"people",
|
|
34
|
+
"recording",
|
|
35
|
+
"roomIntegrations",
|
|
36
|
+
"screenshare",
|
|
31
37
|
"settingsButton",
|
|
32
|
-
"pipButton",
|
|
33
|
-
"moreButton",
|
|
34
|
-
"personality",
|
|
35
38
|
"skipMediaPermissionPrompt",
|
|
36
39
|
"subgridLabels",
|
|
37
|
-
"lowData",
|
|
38
|
-
"breakout",
|
|
39
|
-
"roomIntegrations",
|
|
40
40
|
"timer",
|
|
41
|
+
"toolbarDarkText",
|
|
42
|
+
"topToolbar",
|
|
43
|
+
"video"
|
|
41
44
|
];
|
|
42
45
|
define("WherebyEmbed", {
|
|
43
46
|
oninit() {
|
|
@@ -61,6 +64,7 @@ define("WherebyEmbed", {
|
|
|
61
64
|
"avatarUrl",
|
|
62
65
|
"externalId",
|
|
63
66
|
"title",
|
|
67
|
+
"cameraEffect",
|
|
64
68
|
...boolAttrs,
|
|
65
69
|
].map((a) => a.toLowerCase()),
|
|
66
70
|
onattributechanged({ attributeName, oldValue }) {
|
|
@@ -85,6 +89,9 @@ define("WherebyEmbed", {
|
|
|
85
89
|
this.iframe.current.contentWindow.postMessage({ command, args }, this.roomUrl.origin);
|
|
86
90
|
}
|
|
87
91
|
},
|
|
92
|
+
endMeeting() {
|
|
93
|
+
this._postCommand("end_meeting");
|
|
94
|
+
},
|
|
88
95
|
startRecording() {
|
|
89
96
|
this._postCommand("start_recording");
|
|
90
97
|
},
|
|
@@ -116,7 +123,7 @@ define("WherebyEmbed", {
|
|
|
116
123
|
this.dispatchEvent(new CustomEvent(type, { detail }));
|
|
117
124
|
},
|
|
118
125
|
render() {
|
|
119
|
-
const { avatarurl: avatarUrl, displayname: displayName, lang, metadata, externalid: externalId, minimal, room, groups, virtualbackgroundurl: virtualBackgroundUrl, title, } = this;
|
|
126
|
+
const { avatarurl: avatarUrl, displayname: displayName, cameraeffect: cameraEffect, lang, metadata, externalid: externalId, minimal, room, groups, virtualbackgroundurl: virtualBackgroundUrl, title, } = this;
|
|
120
127
|
let roomUrl, subdomain;
|
|
121
128
|
try {
|
|
122
129
|
({ roomUrl, subdomain } = parseRoomUrlAndSubdomain(room, this.subdomain));
|
|
@@ -125,7 +132,7 @@ define("WherebyEmbed", {
|
|
|
125
132
|
return this.html `Whereby: ${error instanceof Error ? error.message : "unknown error"}`;
|
|
126
133
|
}
|
|
127
134
|
this.roomUrl = roomUrl;
|
|
128
|
-
Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ jsApi: true, we: "1", iframeSource: subdomain }, (displayName && { displayName })), (lang && { lang: lang })), (metadata && { metadata: metadata })), (externalId && { externalId })), (groups && { groups: groups })), (virtualBackgroundUrl && { virtualBackgroundUrl: virtualBackgroundUrl })), (avatarUrl && { avatarUrl: avatarUrl })), (minimal != null && { embed: minimal })), boolAttrs.reduce((o, v) => (this[v.toLowerCase()] != null ? Object.assign(Object.assign({}, o), { [v]: this[v.toLowerCase()] }) : o), {}))).forEach(([k, v]) => {
|
|
135
|
+
Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ jsApi: true, we: "1", iframeSource: subdomain }, (displayName && { displayName })), (lang && { lang: lang })), (metadata && { metadata: metadata })), (externalId && { externalId })), (groups && { groups: groups })), (virtualBackgroundUrl && { virtualBackgroundUrl: virtualBackgroundUrl })), (avatarUrl && { avatarUrl: avatarUrl })), (cameraEffect && { cameraEffect: cameraEffect })), (minimal != null && { embed: minimal })), boolAttrs.reduce((o, v) => (this[v.toLowerCase()] != null ? Object.assign(Object.assign({}, o), { [v]: this[v.toLowerCase()] }) : o), {}))).forEach(([k, v]) => {
|
|
129
136
|
if (!this.roomUrl.searchParams.has(k)) {
|
|
130
137
|
this.roomUrl.searchParams.set(k, v);
|
|
131
138
|
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -99,10 +99,12 @@ interface RoomConnectionActions {
|
|
|
99
99
|
toggleLowDataMode(enabled?: boolean): void;
|
|
100
100
|
acceptWaitingParticipant(participantId: string): void;
|
|
101
101
|
knock(): void;
|
|
102
|
+
joinRoom(): void;
|
|
103
|
+
leaveRoom(): void;
|
|
102
104
|
lockRoom(locked: boolean): void;
|
|
103
105
|
muteParticipants(clientIds: string[]): void;
|
|
104
106
|
kickParticipant(clientId: string): void;
|
|
105
|
-
endMeeting(): void;
|
|
107
|
+
endMeeting(stayBehind?: boolean): void;
|
|
106
108
|
rejectWaitingParticipant(participantId: string): void;
|
|
107
109
|
sendChatMessage(text: string): void;
|
|
108
110
|
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,
|
|
3
|
+
import { debounce, selectChatMessages, selectCloudRecordingRaw, selectLocalParticipantRaw, selectLocalMediaStream, selectRemoteParticipants, selectScreenshares, selectRoomConnectionStatus, selectStreamingRaw, selectWaitingParticipants, createServices, createStore, observeStore, doAppConfigure, doAppStart, doAppStop, 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,12 +99,12 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloud
|
|
|
99
99
|
return state;
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
const browserSdkVersion = "2.
|
|
102
|
+
const browserSdkVersion = "2.12.0";
|
|
103
103
|
|
|
104
104
|
const initialState$1 = {
|
|
105
105
|
chatMessages: [],
|
|
106
106
|
remoteParticipants: [],
|
|
107
|
-
connectionStatus: "
|
|
107
|
+
connectionStatus: "ready",
|
|
108
108
|
screenshares: [],
|
|
109
109
|
waitingParticipants: [],
|
|
110
110
|
};
|
|
@@ -129,7 +129,7 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
|
|
|
129
129
|
const url = new URL(roomUrl);
|
|
130
130
|
const searchParams = new URLSearchParams(url.search);
|
|
131
131
|
const roomKey = roomConnectionOptions.roomKey || searchParams.get("roomKey");
|
|
132
|
-
store.dispatch(
|
|
132
|
+
store.dispatch(doAppConfigure({
|
|
133
133
|
displayName: roomConnectionOptions.displayName || "Guest",
|
|
134
134
|
localMediaOptions: roomConnectionOptions.localMedia
|
|
135
135
|
? undefined
|
|
@@ -139,9 +139,10 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
|
|
|
139
139
|
userAgent: `browser-sdk:${browserSdkVersion}`,
|
|
140
140
|
externalId: roomConnectionOptions.externalId || null,
|
|
141
141
|
}));
|
|
142
|
+
store.dispatch(doAppStart());
|
|
142
143
|
return () => {
|
|
144
|
+
store.dispatch(doAppStop());
|
|
143
145
|
unsubscribe();
|
|
144
|
-
store.dispatch(appLeft());
|
|
145
146
|
};
|
|
146
147
|
}, []);
|
|
147
148
|
React.useEffect(() => {
|
|
@@ -171,18 +172,22 @@ function useRoomConnection(roomUrl, roomConnectionOptions = defaultRoomConnectio
|
|
|
171
172
|
const startScreenshare = React.useCallback(() => store.dispatch(doStartScreenshare()), [store]);
|
|
172
173
|
const stopCloudRecording = React.useCallback(() => store.dispatch(doStopCloudRecording()), [store]);
|
|
173
174
|
const stopScreenshare = React.useCallback(() => store.dispatch(doStopScreenshare()), [store]);
|
|
175
|
+
const joinRoom = React.useCallback(() => store.dispatch(doAppStart()), [store]);
|
|
176
|
+
const leaveRoom = React.useCallback(() => store.dispatch(doAppStop()), [store]);
|
|
174
177
|
const lockRoom = React.useCallback((locked) => store.dispatch(doLockRoom({ locked })), [store]);
|
|
175
178
|
const muteParticipants = React.useCallback((clientIds) => {
|
|
176
179
|
store.dispatch(doRequestAudioEnable({ clientIds, enable: false }));
|
|
177
180
|
}, [store]);
|
|
178
181
|
const kickParticipant = React.useCallback((clientId) => store.dispatch(doKickParticipant({ clientId })), [store]);
|
|
179
|
-
const endMeeting = React.useCallback(() => store.dispatch(doEndMeeting()), [store]);
|
|
182
|
+
const endMeeting = React.useCallback((stayBehind) => store.dispatch(doEndMeeting({ stayBehind })), [store]);
|
|
180
183
|
return {
|
|
181
184
|
state: roomConnectionState,
|
|
182
185
|
actions: {
|
|
183
186
|
toggleLowDataMode,
|
|
184
187
|
acceptWaitingParticipant,
|
|
185
188
|
knock,
|
|
189
|
+
joinRoom,
|
|
190
|
+
leaveRoom,
|
|
186
191
|
lockRoom,
|
|
187
192
|
muteParticipants,
|
|
188
193
|
kickParticipant,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whereby.com/browser-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Modules for integration Whereby video in web apps",
|
|
5
5
|
"author": "Whereby AS",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@reduxjs/toolkit": "^2.2.3",
|
|
78
|
-
"@whereby.com/core": "0.
|
|
78
|
+
"@whereby.com/core": "0.14.0",
|
|
79
79
|
"heresy": "^1.0.4"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|