@tellescope/video-chat 1.3.31 → 1.3.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/video-chat",
3
- "version": "1.3.31",
3
+ "version": "1.3.33",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -34,13 +34,13 @@
34
34
  "@fontsource/roboto": "^4.5.1",
35
35
  "@mui/icons-material": "^5.0.1",
36
36
  "@mui/material": "^5.0.2",
37
- "@tellescope/constants": "^1.3.31",
38
- "@tellescope/react-components": "^1.3.31",
39
- "@tellescope/sdk": "^1.3.31",
40
- "@tellescope/types-client": "^1.3.31",
41
- "@tellescope/types-models": "^1.3.31",
37
+ "@tellescope/constants": "^1.3.32",
38
+ "@tellescope/react-components": "^1.3.32",
39
+ "@tellescope/sdk": "^1.3.32",
40
+ "@tellescope/types-client": "^1.3.32",
41
+ "@tellescope/types-models": "^1.3.32",
42
42
  "@tellescope/types-utilities": "^1.3.20",
43
- "@tellescope/utilities": "^1.3.31",
43
+ "@tellescope/utilities": "^1.3.32",
44
44
  "@typescript-eslint/eslint-plugin": "^4.33.0",
45
45
  "@typescript-eslint/parser": "^4.33.0",
46
46
  "amazon-chime-sdk-component-library-react": "^2.15.0",
@@ -55,7 +55,7 @@
55
55
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
56
56
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
57
57
  },
58
- "gitHead": "9fa02cafdddaf42d015f767b3ff3a4e369e2dd40",
58
+ "gitHead": "9af0a42a6d12f0c2c4366060fb46fe134f6bd04b",
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  }
@@ -23,7 +23,6 @@ import {
23
23
  Flex,
24
24
  Typography,
25
25
  LoadingButton,
26
- useSession,
27
26
  useResolvedSession,
28
27
  Button,
29
28
  } from "@tellescope/react-components"
@@ -121,12 +120,14 @@ export type WaitingRoomProps = {
121
120
  calendarEvent: CalendarEvent,
122
121
  onGoBack?: () => void,
123
122
  }
124
- export const WaitingRoom = ({ calendarEvent, onGoBack } : WaitingRoomProps) => {
125
- const session = useSession()
123
+ interface WaitingRoomResolvedProps extends WaitingRoomProps {
124
+ join: (meetingInfo: { Meeting: MeetingInfo } | string, attendeeInfo?: { Attendee: AttendeeInfo }) => Promise<void>,
125
+ start?: () => void,
126
+ }
127
+ const WaitingRoomShared = ({ calendarEvent, join, start, onGoBack }: WaitingRoomResolvedProps) => {
128
+ const session = useResolvedSession()
126
129
  const [, { findById: findEvent }] = useCalendarEvents()
127
130
  const [, { findById: findMeeting }] = useMeetings()
128
- const { startAndJoinMeeting } = useStartAndJoinMeetingForCalendarEvent(calendarEvent.id)
129
- const { joinMeeting } = useJoinVideoCall()
130
131
 
131
132
  const tsMeeting = findMeeting(calendarEvent?.meetingId ?? '')
132
133
 
@@ -158,12 +159,13 @@ export const WaitingRoom = ({ calendarEvent, onGoBack } : WaitingRoomProps) => {
158
159
  <LoadingButton variant="contained"
159
160
  disabled={
160
161
  (!meetingIsStarted && !isHost)
162
+ || (!meetingIsStarted && !start)
161
163
  || (meetingIsStarted && !tsMeeting)
162
164
  }
163
165
  onClick={
164
166
  meetingIsStarted
165
- ? () => joinMeeting(tsMeeting.id)
166
- : startAndJoinMeeting
167
+ ? () => join(tsMeeting.id)
168
+ : start
167
169
  }
168
170
  submitText={
169
171
  meetingIsStarted ? "Join Meeting" : "Start Meeting"
@@ -191,6 +193,26 @@ export const WaitingRoom = ({ calendarEvent, onGoBack } : WaitingRoomProps) => {
191
193
  )
192
194
  }
193
195
 
196
+ // Only users can start meeting, avoid using useStartAndJoin... hook as enduser
197
+ const WaitingRoomUser = (props : WaitingRoomProps) => {
198
+ const { startAndJoinMeeting } = useStartAndJoinMeetingForCalendarEvent(props.calendarEvent.id)
199
+ const { joinMeeting } = useJoinVideoCall()
200
+
201
+ return <WaitingRoomShared {...props} start={startAndJoinMeeting} join={joinMeeting} />
202
+ }
203
+
204
+ const WaitingRoomEnduser = (props : WaitingRoomProps) => {
205
+ const { joinMeeting } = useJoinVideoCall()
206
+ return <WaitingRoomShared {...props} join={joinMeeting} />
207
+ }
208
+
209
+ export const WaitingRoom = (props: WaitingRoomProps) => {
210
+ const session = useResolvedSession()
211
+ const Component = session.type === 'user' ? WaitingRoomUser : WaitingRoomEnduser
212
+
213
+ return <Component {...props} />
214
+ }
215
+
194
216
  export interface VideoCallNativeProps {
195
217
  onLeave?: () => void,
196
218
  }