@whereby.com/browser-sdk 3.10.7 → 3.10.9
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/README.md +19 -1
- package/dist/cdn/v3-react.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.esm.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -67,7 +67,10 @@ The `useRoomConnection` hook provides a way to connect participants in a given
|
|
|
67
67
|
room, subscribe to state updates, and perform actions on the connection, like
|
|
68
68
|
toggling camera or microphone.
|
|
69
69
|
|
|
70
|
+
Note: from V3 this requires the `WherebyProvder` as a parent of this component. See [the docs](https://docs.whereby.com/reference/react-hooks-reference/guides-and-concepts/migrate-from-version-2.x-to-3) for details
|
|
71
|
+
|
|
70
72
|
```js
|
|
73
|
+
import { useEffect } from "react"
|
|
71
74
|
import { useRoomConnection } from "@whereby.com/browser-sdk/react";
|
|
72
75
|
|
|
73
76
|
function MyCallUX( { roomUrl, localStream }) {
|
|
@@ -83,8 +86,14 @@ function MyCallUX( { roomUrl, localStream }) {
|
|
|
83
86
|
);
|
|
84
87
|
|
|
85
88
|
const { connectionState, remoteParticipants } = state;
|
|
86
|
-
const { toggleCamera, toggleMicrophone } = actions;
|
|
89
|
+
const { toggleCamera, toggleMicrophone, joinRoom, leaveRoom } = actions;
|
|
87
90
|
const { VideoView } = components;
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
/* join the room when this component renders */
|
|
94
|
+
joinRoom()
|
|
95
|
+
return () => leaveRoom()
|
|
96
|
+
}, [])
|
|
88
97
|
|
|
89
98
|
return <div className="videoGrid">
|
|
90
99
|
{ /* Render any UI, making use of state */ }
|
|
@@ -178,3 +187,12 @@ web component. The following changes are necessary when upgrading to v2:
|
|
|
178
187
|
The functionality of the web component should be exactly as the latest version
|
|
179
188
|
on the v1 branch, but a TypeScript definition is now available for projects
|
|
180
189
|
using this language.
|
|
190
|
+
|
|
191
|
+
## Migrating from version v2.x to v3
|
|
192
|
+
|
|
193
|
+
Version 3 of the browser-sdk contains three breaking changes:
|
|
194
|
+
- WherebyProvider is now required to be rendered, and all usage of browser-sdk needs to be in children of the provider.
|
|
195
|
+
- useRoomConnection does not automatically join the room any longer. It's required to manually call joinRoom() from useRoomConnection.actions
|
|
196
|
+
- useRoomConnection.components is deprecated.
|
|
197
|
+
|
|
198
|
+
See [here](https://docs.whereby.com/reference/react-hooks-reference/guides-and-concepts/migrate-from-version-2.x-to-3) for more details
|