@videosdk.live/react-sdk 0.1.62 → 0.1.63
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/index.js +265 -480
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +265 -480
- package/dist/index.modern.js.map +1 -1
- package/dist/types/participant/useParticipant.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -42,69 +42,69 @@ var eventEmitter = new EventEmitter();
|
|
|
42
42
|
eventEmitter.setMaxListeners(9999);
|
|
43
43
|
|
|
44
44
|
var MeetingProviderContex = React.createContext();
|
|
45
|
+
|
|
45
46
|
var useMeeting = function useMeeting(_temp) {
|
|
46
47
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
48
|
+
_ref$onParticipantJoi = _ref.onParticipantJoined,
|
|
49
|
+
onParticipantJoined = _ref$onParticipantJoi === void 0 ? function () {} : _ref$onParticipantJoi,
|
|
50
|
+
_ref$onParticipantLef = _ref.onParticipantLeft,
|
|
51
|
+
onParticipantLeft = _ref$onParticipantLef === void 0 ? function () {} : _ref$onParticipantLef,
|
|
52
|
+
_ref$onSpeakerChanged = _ref.onSpeakerChanged,
|
|
53
|
+
onSpeakerChanged = _ref$onSpeakerChanged === void 0 ? function () {} : _ref$onSpeakerChanged,
|
|
54
|
+
_ref$onPresenterChang = _ref.onPresenterChanged,
|
|
55
|
+
onPresenterChanged = _ref$onPresenterChang === void 0 ? function () {} : _ref$onPresenterChang,
|
|
56
|
+
_ref$onMainParticipan = _ref.onMainParticipantChanged,
|
|
57
|
+
onMainParticipantChanged = _ref$onMainParticipan === void 0 ? function () {} : _ref$onMainParticipan,
|
|
58
|
+
_ref$onEntryRequested = _ref.onEntryRequested,
|
|
59
|
+
onEntryRequested = _ref$onEntryRequested === void 0 ? function () {} : _ref$onEntryRequested,
|
|
60
|
+
_ref$onEntryResponded = _ref.onEntryResponded,
|
|
61
|
+
onEntryResponded = _ref$onEntryResponded === void 0 ? function () {} : _ref$onEntryResponded,
|
|
62
|
+
_ref$onRecordingStart = _ref.onRecordingStarted,
|
|
63
|
+
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart,
|
|
64
|
+
_ref$onRecordingStopp = _ref.onRecordingStopped,
|
|
65
|
+
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp,
|
|
66
|
+
_ref$onChatMessage = _ref.onChatMessage,
|
|
67
|
+
onChatMessage = _ref$onChatMessage === void 0 ? function () {} : _ref$onChatMessage,
|
|
68
|
+
_ref$onMeetingJoined = _ref.onMeetingJoined,
|
|
69
|
+
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined,
|
|
70
|
+
_ref$onMeetingLeft = _ref.onMeetingLeft,
|
|
71
|
+
onMeetingLeft = _ref$onMeetingLeft === void 0 ? function () {} : _ref$onMeetingLeft,
|
|
72
|
+
_ref$onLiveStreamStar = _ref.onLiveStreamStarted,
|
|
73
|
+
onLiveStreamStarted = _ref$onLiveStreamStar === void 0 ? function () {} : _ref$onLiveStreamStar,
|
|
74
|
+
_ref$onLiveStreamStop = _ref.onLiveStreamStopped,
|
|
75
|
+
onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop,
|
|
76
|
+
_ref$onVideoStateChan = _ref.onVideoStateChanged,
|
|
77
|
+
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan,
|
|
78
|
+
_ref$onVideoSeeked = _ref.onVideoSeeked,
|
|
79
|
+
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked,
|
|
80
|
+
_ref$onWebcamRequeste = _ref.onWebcamRequested,
|
|
81
|
+
onWebcamRequested = _ref$onWebcamRequeste === void 0 ? function () {} : _ref$onWebcamRequeste,
|
|
82
|
+
_ref$onMicRequested = _ref.onMicRequested,
|
|
83
|
+
onMicRequested = _ref$onMicRequested === void 0 ? function () {} : _ref$onMicRequested,
|
|
84
|
+
_ref$onPinStateChange = _ref.onPinStateChanged,
|
|
85
|
+
onPinStateChanged = _ref$onPinStateChange === void 0 ? function () {} : _ref$onPinStateChange,
|
|
86
|
+
_ref$onConnectionOpen = _ref.onConnectionOpen,
|
|
87
|
+
onConnectionOpen = _ref$onConnectionOpen === void 0 ? function () {} : _ref$onConnectionOpen,
|
|
88
|
+
_ref$onConnetionClose = _ref.onConnetionClose,
|
|
89
|
+
onConnetionClose = _ref$onConnetionClose === void 0 ? function () {} : _ref$onConnetionClose,
|
|
90
|
+
_ref$onSwitchMeeting = _ref.onSwitchMeeting,
|
|
91
|
+
onSwitchMeeting = _ref$onSwitchMeeting === void 0 ? function () {} : _ref$onSwitchMeeting,
|
|
92
|
+
_ref$onError = _ref.onError,
|
|
93
|
+
onError = _ref$onError === void 0 ? function () {} : _ref$onError,
|
|
94
|
+
_ref$onHlsStarted = _ref.onHlsStarted,
|
|
95
|
+
onHlsStarted = _ref$onHlsStarted === void 0 ? function () {} : _ref$onHlsStarted,
|
|
96
|
+
_ref$onHlsStopped = _ref.onHlsStopped,
|
|
97
|
+
onHlsStopped = _ref$onHlsStopped === void 0 ? function () {} : _ref$onHlsStopped,
|
|
98
|
+
_ref$onHlsStateChange = _ref.onHlsStateChanged,
|
|
99
|
+
onHlsStateChanged = _ref$onHlsStateChange === void 0 ? function () {} : _ref$onHlsStateChange,
|
|
100
|
+
_ref$onRecordingState = _ref.onRecordingStateChanged,
|
|
101
|
+
onRecordingStateChanged = _ref$onRecordingState === void 0 ? function () {} : _ref$onRecordingState,
|
|
102
|
+
_ref$onLivestreamStat = _ref.onLivestreamStateChanged,
|
|
103
|
+
onLivestreamStateChanged = _ref$onLivestreamStat === void 0 ? function () {} : _ref$onLivestreamStat,
|
|
104
|
+
_ref$onMeetingStateCh = _ref.onMeetingStateChanged,
|
|
105
|
+
onMeetingStateChanged = _ref$onMeetingStateCh === void 0 ? function () {} : _ref$onMeetingStateCh,
|
|
106
|
+
_ref$onParticipantMod = _ref.onParticipantModeChanged,
|
|
107
|
+
onParticipantModeChanged = _ref$onParticipantMod === void 0 ? function () {} : _ref$onParticipantMod;
|
|
108
108
|
React.useEffect(function () {
|
|
109
109
|
eventEmitter.on(events['participant-joined'], onParticipantJoined);
|
|
110
110
|
eventEmitter.on(events['participant-left'], onParticipantLeft);
|
|
@@ -173,66 +173,66 @@ var useMeeting = function useMeeting(_temp) {
|
|
|
173
173
|
};
|
|
174
174
|
var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
175
175
|
var children = _ref2.children,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
176
|
+
_ref2$onParticipantJo = _ref2.onParticipantJoined,
|
|
177
|
+
onParticipantJoined = _ref2$onParticipantJo === void 0 ? function () {} : _ref2$onParticipantJo,
|
|
178
|
+
_ref2$onParticipantLe = _ref2.onParticipantLeft,
|
|
179
|
+
onParticipantLeft = _ref2$onParticipantLe === void 0 ? function () {} : _ref2$onParticipantLe,
|
|
180
|
+
_ref2$onSpeakerChange = _ref2.onSpeakerChanged,
|
|
181
|
+
onSpeakerChanged = _ref2$onSpeakerChange === void 0 ? function () {} : _ref2$onSpeakerChange,
|
|
182
|
+
_ref2$onPresenterChan = _ref2.onPresenterChanged,
|
|
183
|
+
onPresenterChanged = _ref2$onPresenterChan === void 0 ? function () {} : _ref2$onPresenterChan,
|
|
184
|
+
_ref2$onMainParticipa = _ref2.onMainParticipantChanged,
|
|
185
|
+
onMainParticipantChanged = _ref2$onMainParticipa === void 0 ? function () {} : _ref2$onMainParticipa,
|
|
186
|
+
_ref2$onEntryRequeste = _ref2.onEntryRequested,
|
|
187
|
+
onEntryRequested = _ref2$onEntryRequeste === void 0 ? function () {} : _ref2$onEntryRequeste,
|
|
188
|
+
_ref2$onEntryResponde = _ref2.onEntryResponded,
|
|
189
|
+
onEntryResponded = _ref2$onEntryResponde === void 0 ? function () {} : _ref2$onEntryResponde,
|
|
190
|
+
_ref2$onRecordingStar = _ref2.onRecordingStarted,
|
|
191
|
+
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar,
|
|
192
|
+
_ref2$onRecordingStop = _ref2.onRecordingStopped,
|
|
193
|
+
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop,
|
|
194
|
+
_ref2$onChatMessage = _ref2.onChatMessage,
|
|
195
|
+
onChatMessage = _ref2$onChatMessage === void 0 ? function () {} : _ref2$onChatMessage,
|
|
196
|
+
_ref2$onMeetingJoined = _ref2.onMeetingJoined,
|
|
197
|
+
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined,
|
|
198
|
+
_ref2$onMeetingLeft = _ref2.onMeetingLeft,
|
|
199
|
+
onMeetingLeft = _ref2$onMeetingLeft === void 0 ? function () {} : _ref2$onMeetingLeft,
|
|
200
|
+
_ref2$onLiveStreamSta = _ref2.onLiveStreamStarted,
|
|
201
|
+
onLiveStreamStarted = _ref2$onLiveStreamSta === void 0 ? function () {} : _ref2$onLiveStreamSta,
|
|
202
|
+
_ref2$onLiveStreamSto = _ref2.onLiveStreamStopped,
|
|
203
|
+
onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto,
|
|
204
|
+
_ref2$onVideoStateCha = _ref2.onVideoStateChanged,
|
|
205
|
+
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha,
|
|
206
|
+
_ref2$onVideoSeeked = _ref2.onVideoSeeked,
|
|
207
|
+
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked,
|
|
208
|
+
_ref2$onWebcamRequest = _ref2.onWebcamRequested,
|
|
209
|
+
onWebcamRequested = _ref2$onWebcamRequest === void 0 ? function () {} : _ref2$onWebcamRequest,
|
|
210
|
+
_ref2$onMicRequested = _ref2.onMicRequested,
|
|
211
|
+
onMicRequested = _ref2$onMicRequested === void 0 ? function () {} : _ref2$onMicRequested,
|
|
212
|
+
_ref2$onPinStateChang = _ref2.onPinStateChanged,
|
|
213
|
+
onPinStateChanged = _ref2$onPinStateChang === void 0 ? function () {} : _ref2$onPinStateChang,
|
|
214
|
+
_ref2$onConnectionOpe = _ref2.onConnectionOpen,
|
|
215
|
+
onConnectionOpen = _ref2$onConnectionOpe === void 0 ? function () {} : _ref2$onConnectionOpe,
|
|
216
|
+
_ref2$onConnetionClos = _ref2.onConnetionClose,
|
|
217
|
+
onConnetionClose = _ref2$onConnetionClos === void 0 ? function () {} : _ref2$onConnetionClos,
|
|
218
|
+
_ref2$onSwitchMeeting = _ref2.onSwitchMeeting,
|
|
219
|
+
onSwitchMeeting = _ref2$onSwitchMeeting === void 0 ? function () {} : _ref2$onSwitchMeeting,
|
|
220
|
+
_ref2$onError = _ref2.onError,
|
|
221
|
+
onError = _ref2$onError === void 0 ? function () {} : _ref2$onError,
|
|
222
|
+
_ref2$onHlsStarted = _ref2.onHlsStarted,
|
|
223
|
+
onHlsStarted = _ref2$onHlsStarted === void 0 ? function () {} : _ref2$onHlsStarted,
|
|
224
|
+
_ref2$onHlsStopped = _ref2.onHlsStopped,
|
|
225
|
+
onHlsStopped = _ref2$onHlsStopped === void 0 ? function () {} : _ref2$onHlsStopped,
|
|
226
|
+
_ref2$onHlsStateChang = _ref2.onHlsStateChanged,
|
|
227
|
+
onHlsStateChanged = _ref2$onHlsStateChang === void 0 ? function () {} : _ref2$onHlsStateChang,
|
|
228
|
+
_ref2$onRecordingStat = _ref2.onRecordingStateChanged,
|
|
229
|
+
onRecordingStateChanged = _ref2$onRecordingStat === void 0 ? function () {} : _ref2$onRecordingStat,
|
|
230
|
+
_ref2$onLivestreamSta = _ref2.onLivestreamStateChanged,
|
|
231
|
+
onLivestreamStateChanged = _ref2$onLivestreamSta === void 0 ? function () {} : _ref2$onLivestreamSta,
|
|
232
|
+
_ref2$onMeetingStateC = _ref2.onMeetingStateChanged,
|
|
233
|
+
onMeetingStateChanged = _ref2$onMeetingStateC === void 0 ? function () {} : _ref2$onMeetingStateC,
|
|
234
|
+
_ref2$onParticipantMo = _ref2.onParticipantModeChanged,
|
|
235
|
+
onParticipantModeChanged = _ref2$onParticipantMo === void 0 ? function () {} : _ref2$onParticipantMo;
|
|
236
236
|
React.useEffect(function () {
|
|
237
237
|
eventEmitter.on(events['meeting-state-changed'], onMeetingStateChanged);
|
|
238
238
|
eventEmitter.on(events['participant-joined'], onParticipantJoined);
|
|
@@ -300,92 +300,72 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
300
300
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MeetingProviderContex.Consumer, null, children));
|
|
301
301
|
};
|
|
302
302
|
|
|
303
|
-
var version = "0.1.
|
|
303
|
+
var version = "0.1.61";
|
|
304
304
|
|
|
305
305
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
306
306
|
var children = _ref.children,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
307
|
+
config = _ref.config,
|
|
308
|
+
token = _ref.token,
|
|
309
|
+
joinWithoutUserInteraction = _ref.joinWithoutUserInteraction,
|
|
310
|
+
_reinitialiseMeetingOnConfigChange = _ref.reinitialiseMeetingOnConfigChange,
|
|
311
|
+
deviceInfo = _ref.deviceInfo;
|
|
313
312
|
var _useState = React.useState(null),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
meeting = _useState[0],
|
|
314
|
+
setMeeting = _useState[1];
|
|
317
315
|
var _useState2 = React.useState(null),
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
localParticipant = _useState2[0],
|
|
317
|
+
setLocalParticipant = _useState2[1];
|
|
321
318
|
var _useState3 = React.useState(null),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
319
|
+
mainParticipant = _useState3[0],
|
|
320
|
+
setMainParticipant = _useState3[1];
|
|
325
321
|
var _useState4 = React.useState(null),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
322
|
+
activeSpeakerId = _useState4[0],
|
|
323
|
+
setActiveSpeakerId = _useState4[1];
|
|
329
324
|
var _useState5 = React.useState(null),
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
325
|
+
presenterId = _useState5[0],
|
|
326
|
+
setPresenterId = _useState5[1];
|
|
333
327
|
var _useState6 = React.useState(false),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
328
|
+
localMicOn = _useState6[0],
|
|
329
|
+
setLocalMicOn = _useState6[1];
|
|
337
330
|
var _useState7 = React.useState(false),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
331
|
+
localWebcamOn = _useState7[0],
|
|
332
|
+
setLocalWebcamOn = _useState7[1];
|
|
341
333
|
var _useState8 = React.useState(false),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
334
|
+
localScreenShareOn = _useState8[0],
|
|
335
|
+
setLocalScreenShareOn = _useState8[1];
|
|
345
336
|
var _useState9 = React.useState(false),
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
337
|
+
isRecording = _useState9[0],
|
|
338
|
+
setIsRecording = _useState9[1];
|
|
349
339
|
var _useState10 = React.useState([]),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
340
|
+
messages = _useState10[0],
|
|
341
|
+
setMessages = _useState10[1];
|
|
353
342
|
var _useState11 = React.useState(new Map()),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
343
|
+
participants = _useState11[0],
|
|
344
|
+
setParticipants = _useState11[1];
|
|
357
345
|
var _useState12 = React.useState(new Map()),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
346
|
+
pinnedParticipants = _useState12[0],
|
|
347
|
+
setPinnedParticipants = _useState12[1];
|
|
361
348
|
var _useState13 = React.useState(false),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
349
|
+
isLiveStreaming = _useState13[0],
|
|
350
|
+
setIsLiveStreaming = _useState13[1];
|
|
365
351
|
var _useState14 = React.useState(new Map()),
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
352
|
+
connections = _useState14[0],
|
|
353
|
+
setConnections = _useState14[1];
|
|
369
354
|
var _useState15 = React.useState(false),
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
355
|
+
isMeetingJoined = _useState15[0],
|
|
356
|
+
setIsMeetingJoined = _useState15[1];
|
|
373
357
|
var _useState16 = React.useState(false),
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
358
|
+
isHls = _useState16[0],
|
|
359
|
+
setIsHls = _useState16[1];
|
|
377
360
|
var _useState17 = React.useState(null),
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
361
|
+
recordingState = _useState17[0],
|
|
362
|
+
setRecordingState = _useState17[1];
|
|
381
363
|
var _useState18 = React.useState(null),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
364
|
+
livestreamState = _useState18[0],
|
|
365
|
+
setLivestreamState = _useState18[1];
|
|
385
366
|
var _useState19 = React.useState(null),
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
367
|
+
hlsState = _useState19[0],
|
|
368
|
+
setHlsState = _useState19[1];
|
|
389
369
|
var meetingRef = React.useRef();
|
|
390
370
|
var localMicOnRef = React.useRef();
|
|
391
371
|
var localWebcamOnRef = React.useRef();
|
|
@@ -422,7 +402,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
422
402
|
React.useEffect(function () {
|
|
423
403
|
isHlsRef.current = isHls;
|
|
424
404
|
}, [isHls]);
|
|
425
|
-
|
|
426
405
|
var resetStates = function resetStates() {
|
|
427
406
|
setMeeting(null);
|
|
428
407
|
setLocalParticipant(null);
|
|
@@ -444,7 +423,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
444
423
|
setLivestreamState(null);
|
|
445
424
|
setHlsState(null);
|
|
446
425
|
};
|
|
447
|
-
|
|
448
426
|
var _handle_participant_joined = function _handle_participant_joined(participant) {
|
|
449
427
|
setParticipants(function (participants) {
|
|
450
428
|
participants.set(participant.id, participant);
|
|
@@ -453,7 +431,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
453
431
|
});
|
|
454
432
|
eventEmitter.emit(events['participant-joined'], participant);
|
|
455
433
|
};
|
|
456
|
-
|
|
457
434
|
var _handle_participant_left = function _handle_participant_left(participant) {
|
|
458
435
|
setParticipants(function (participants) {
|
|
459
436
|
participants["delete"](participant.id);
|
|
@@ -462,50 +439,40 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
462
439
|
});
|
|
463
440
|
eventEmitter.emit(events['participant-left'], participant);
|
|
464
441
|
};
|
|
465
|
-
|
|
466
442
|
var _handle_presenter_changed = function _handle_presenter_changed(presenterId) {
|
|
467
443
|
var _meetingRef$current, _meetingRef$current$l;
|
|
468
|
-
|
|
469
444
|
setPresenterId(presenterId);
|
|
470
445
|
setLocalScreenShareOn(presenterId === (meetingRef === null || meetingRef === void 0 ? void 0 : (_meetingRef$current = meetingRef.current) === null || _meetingRef$current === void 0 ? void 0 : (_meetingRef$current$l = _meetingRef$current.localParticipant) === null || _meetingRef$current$l === void 0 ? void 0 : _meetingRef$current$l.id));
|
|
471
446
|
eventEmitter.emit(events['presenter-changed'], presenterId);
|
|
472
447
|
};
|
|
473
|
-
|
|
474
448
|
var _handle_main_participant_changed = function _handle_main_participant_changed(participant) {
|
|
475
449
|
setMainParticipant(participant);
|
|
476
450
|
eventEmitter.emit(events['main-participant-changed'], participant);
|
|
477
451
|
};
|
|
478
|
-
|
|
479
452
|
var _handle_speaker_changed = function _handle_speaker_changed(activeSpeakerId) {
|
|
480
453
|
setActiveSpeakerId(activeSpeakerId);
|
|
481
454
|
eventEmitter.emit(events['speaker-changed'], activeSpeakerId);
|
|
482
455
|
};
|
|
483
|
-
|
|
484
456
|
var _handle_chat_message = function _handle_chat_message(data) {
|
|
485
457
|
setMessages(function (s) {
|
|
486
458
|
return [].concat(s, [data]);
|
|
487
459
|
});
|
|
488
460
|
eventEmitter.emit(events['chat-message'], data);
|
|
489
461
|
};
|
|
490
|
-
|
|
491
462
|
var _handle_entry_requested = function _handle_entry_requested(data) {
|
|
492
463
|
eventEmitter.emit(events['entry-requested'], data);
|
|
493
464
|
};
|
|
494
|
-
|
|
495
465
|
var _handle_entry_responded = function _handle_entry_responded(participantId, decision) {
|
|
496
466
|
eventEmitter.emit(events['entry-responded'], participantId, decision);
|
|
497
467
|
};
|
|
498
|
-
|
|
499
468
|
var _handle_recording_started = function _handle_recording_started() {
|
|
500
469
|
setIsRecording(true);
|
|
501
470
|
eventEmitter.emit(events['recording-started']);
|
|
502
471
|
};
|
|
503
|
-
|
|
504
472
|
var _handle_recording_stopped = function _handle_recording_stopped() {
|
|
505
473
|
setIsRecording(false);
|
|
506
474
|
eventEmitter.emit(events['recording-stopped']);
|
|
507
475
|
};
|
|
508
|
-
|
|
509
476
|
var _handle_localParticipant_stream_enabled = function _handle_localParticipant_stream_enabled(stream) {
|
|
510
477
|
if (stream.track.readyState === 'live') {
|
|
511
478
|
if (stream.kind === 'video') {
|
|
@@ -515,7 +482,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
515
482
|
}
|
|
516
483
|
}
|
|
517
484
|
};
|
|
518
|
-
|
|
519
485
|
var _handle_localParticipant_stream_disabled = function _handle_localParticipant_stream_disabled(stream) {
|
|
520
486
|
if (stream.track.readyState === 'ended') {
|
|
521
487
|
if (stream.kind === 'video') {
|
|
@@ -525,43 +491,34 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
525
491
|
}
|
|
526
492
|
}
|
|
527
493
|
};
|
|
528
|
-
|
|
529
494
|
var _handle_live_stream_started = function _handle_live_stream_started(data) {
|
|
530
495
|
setIsLiveStreaming(true);
|
|
531
496
|
eventEmitter.emit(events['live-stream-started'], data);
|
|
532
497
|
};
|
|
533
|
-
|
|
534
498
|
var _handle_live_stream_stopped = function _handle_live_stream_stopped() {
|
|
535
499
|
setIsLiveStreaming(false);
|
|
536
500
|
eventEmitter.emit(events['live-stream-stopped']);
|
|
537
501
|
};
|
|
538
|
-
|
|
539
502
|
var _handle_hls_started = function _handle_hls_started(data) {
|
|
540
503
|
setIsHls(true);
|
|
541
504
|
eventEmitter.emit(events['hls-started'], data);
|
|
542
505
|
};
|
|
543
|
-
|
|
544
506
|
var _handle_hls_stopped = function _handle_hls_stopped() {
|
|
545
507
|
setIsHls(false);
|
|
546
508
|
eventEmitter.emit(events['hls-stopped']);
|
|
547
509
|
};
|
|
548
|
-
|
|
549
510
|
var _handle_video_state_changed = function _handle_video_state_changed(data) {
|
|
550
511
|
eventEmitter.emit(events['video-state-changed'], data);
|
|
551
512
|
};
|
|
552
|
-
|
|
553
513
|
var _handle_video_seeked = function _handle_video_seeked(data) {
|
|
554
514
|
eventEmitter.emit(events['video-seeked'], data);
|
|
555
515
|
};
|
|
556
|
-
|
|
557
516
|
var _handle_webcam_requested = function _handle_webcam_requested(data) {
|
|
558
517
|
eventEmitter.emit(events['webcam-requested'], data);
|
|
559
518
|
};
|
|
560
|
-
|
|
561
519
|
var _handle_mic_requested = function _handle_mic_requested(data) {
|
|
562
520
|
eventEmitter.emit(events['mic-requested'], data);
|
|
563
521
|
};
|
|
564
|
-
|
|
565
522
|
var _handle_meeting_joined = function _handle_meeting_joined(data) {
|
|
566
523
|
joinedOnFirstRender.current = true;
|
|
567
524
|
setMessages(function (s) {
|
|
@@ -570,14 +527,11 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
570
527
|
eventEmitter.emit(events['meeting-joined'], data);
|
|
571
528
|
setIsMeetingJoined(true);
|
|
572
529
|
};
|
|
573
|
-
|
|
574
530
|
var _handle_meeting_left = function _handle_meeting_left() {
|
|
575
531
|
eventEmitter.emit(events['meeting-left']);
|
|
576
532
|
var meeting = meetingRef.current;
|
|
577
|
-
|
|
578
533
|
if (meeting) {
|
|
579
534
|
var _meeting$localPartici;
|
|
580
|
-
|
|
581
535
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : meeting.off) === 'function') {
|
|
582
536
|
meeting.off('meeting-state-changed', _handle_meeting_state_changed);
|
|
583
537
|
meeting.off('participant-joined', _handle_participant_joined);
|
|
@@ -610,27 +564,23 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
610
564
|
meeting.off('hls-state-changed', _handle_hls_state_changed);
|
|
611
565
|
meeting.off('participant-mode-changed', _handel_participant_mode_changed);
|
|
612
566
|
}
|
|
613
|
-
|
|
614
567
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') {
|
|
615
568
|
meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled);
|
|
616
569
|
meeting.localParticipant.off('stream-disabled', _handle_localParticipant_stream_disabled);
|
|
617
570
|
}
|
|
618
|
-
|
|
619
571
|
resetStates();
|
|
620
572
|
}
|
|
621
573
|
};
|
|
622
|
-
|
|
623
574
|
var _handle_pin_state_changed = function _handle_pin_state_changed(_ref2) {
|
|
624
575
|
var participantId = _ref2.participantId,
|
|
625
|
-
|
|
626
|
-
|
|
576
|
+
state = _ref2.state,
|
|
577
|
+
pinnedBy = _ref2.pinnedBy;
|
|
627
578
|
setPinnedParticipants(function (pinnedParticipants) {
|
|
628
579
|
if (!state.cam && !state.share) {
|
|
629
580
|
pinnedParticipants["delete"](participantId);
|
|
630
581
|
} else {
|
|
631
582
|
pinnedParticipants.set(participantId, state);
|
|
632
583
|
}
|
|
633
|
-
|
|
634
584
|
var pinnedParticipantsToSet = new Map(pinnedParticipants);
|
|
635
585
|
return pinnedParticipantsToSet;
|
|
636
586
|
});
|
|
@@ -640,7 +590,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
640
590
|
pinnedBy: pinnedBy
|
|
641
591
|
});
|
|
642
592
|
};
|
|
643
|
-
|
|
644
593
|
var _handle_connection_open = function _handle_connection_open(connection) {
|
|
645
594
|
setConnections(function (s) {
|
|
646
595
|
s.set(connection.id, connection);
|
|
@@ -649,7 +598,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
649
598
|
});
|
|
650
599
|
eventEmitter.emit(events['connection-open'], connection);
|
|
651
600
|
};
|
|
652
|
-
|
|
653
601
|
var _handle_connection_close = function _handle_connection_close(connectionId) {
|
|
654
602
|
setConnections(function (s) {
|
|
655
603
|
s["delete"](connectionId);
|
|
@@ -658,37 +606,29 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
658
606
|
});
|
|
659
607
|
eventEmitter.emit(events['connection-close'], connectionId);
|
|
660
608
|
};
|
|
661
|
-
|
|
662
609
|
var _handle_switch_meeting = function _handle_switch_meeting(d) {
|
|
663
610
|
eventEmitter.emit(events['switch-meeting'], d);
|
|
664
611
|
};
|
|
665
|
-
|
|
666
612
|
var _handle_error = function _handle_error(data) {
|
|
667
613
|
eventEmitter.emit(events['error'], data);
|
|
668
614
|
};
|
|
669
|
-
|
|
670
615
|
var _handle_recording_state_changed = function _handle_recording_state_changed(data) {
|
|
671
616
|
setRecordingState(data === null || data === void 0 ? void 0 : data.status);
|
|
672
617
|
eventEmitter.emit(events['recording-state-changed'], data);
|
|
673
618
|
};
|
|
674
|
-
|
|
675
619
|
var _handle_livestream_state_changed = function _handle_livestream_state_changed(data) {
|
|
676
620
|
setLivestreamState(data === null || data === void 0 ? void 0 : data.status);
|
|
677
621
|
eventEmitter.emit(events['livestream-state-changed'], data);
|
|
678
622
|
};
|
|
679
|
-
|
|
680
623
|
var _handle_hls_state_changed = function _handle_hls_state_changed(data) {
|
|
681
624
|
setHlsState(data === null || data === void 0 ? void 0 : data.status);
|
|
682
625
|
eventEmitter.emit(events['hls-state-changed'], data);
|
|
683
626
|
};
|
|
684
|
-
|
|
685
627
|
var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) {
|
|
686
628
|
eventEmitter.emit(events['meeting-state-changed'], data);
|
|
687
629
|
};
|
|
688
|
-
|
|
689
630
|
var _handel_participant_mode_changed = function _handel_participant_mode_changed(data) {
|
|
690
631
|
var _meetingRef$current2, _meetingRef$current2$;
|
|
691
|
-
|
|
692
632
|
setParticipants(function (participants) {
|
|
693
633
|
var part = participants.get(data.participantId);
|
|
694
634
|
part.mode = data.mode;
|
|
@@ -702,15 +642,13 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
702
642
|
return participant;
|
|
703
643
|
});
|
|
704
644
|
}
|
|
705
|
-
|
|
706
645
|
eventEmitter.emit(events['participant-mode-changed'], data);
|
|
707
646
|
};
|
|
708
|
-
|
|
709
647
|
var join = function join() {
|
|
710
648
|
var meeting = jsSdk.VideoSDK && jsSdk.VideoSDK.initMeeting(configRef.current);
|
|
711
649
|
setMeeting(meeting);
|
|
712
650
|
var localParticipant = meeting.localParticipant,
|
|
713
|
-
|
|
651
|
+
participants = meeting.participants;
|
|
714
652
|
participants.set(localParticipant.id, localParticipant);
|
|
715
653
|
setParticipants(participants);
|
|
716
654
|
setLocalParticipant(localParticipant);
|
|
@@ -748,169 +686,129 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
748
686
|
meeting.localParticipant.on('stream-disabled', _handle_localParticipant_stream_disabled);
|
|
749
687
|
meeting.join();
|
|
750
688
|
};
|
|
751
|
-
|
|
752
689
|
var leave = function leave() {
|
|
753
690
|
var meeting = meetingRef.current;
|
|
754
|
-
|
|
755
691
|
if (meeting) {
|
|
756
692
|
meeting.leave();
|
|
757
693
|
}
|
|
758
694
|
};
|
|
759
|
-
|
|
760
695
|
var end = function end() {
|
|
761
696
|
var meeting = meetingRef.current;
|
|
762
|
-
|
|
763
697
|
if (meeting) {
|
|
764
698
|
meeting.end();
|
|
765
699
|
}
|
|
766
700
|
};
|
|
767
|
-
|
|
768
701
|
var startRecording = function startRecording(webhookUrl, awsDirPath, config) {
|
|
769
702
|
var meeting = meetingRef.current;
|
|
770
|
-
|
|
771
703
|
if (meeting) {
|
|
772
704
|
meeting.startRecording(webhookUrl, awsDirPath, config);
|
|
773
705
|
}
|
|
774
706
|
};
|
|
775
|
-
|
|
776
707
|
var stopRecording = function stopRecording() {
|
|
777
708
|
var meeting = meetingRef.current;
|
|
778
|
-
|
|
779
709
|
if (meeting) {
|
|
780
710
|
var _isRecording = isRecordingRef.current;
|
|
781
|
-
|
|
782
711
|
if (_isRecording) {
|
|
783
712
|
meeting.stopRecording();
|
|
784
713
|
}
|
|
785
714
|
}
|
|
786
715
|
};
|
|
787
|
-
|
|
788
716
|
var unmuteMic = function unmuteMic(customAudioTrack) {
|
|
789
717
|
if (customAudioTrack === void 0) {
|
|
790
718
|
customAudioTrack = undefined;
|
|
791
719
|
}
|
|
792
|
-
|
|
793
720
|
var meeting = meetingRef.current;
|
|
794
|
-
|
|
795
721
|
if (meeting) {
|
|
796
722
|
meeting.unmuteMic(customAudioTrack);
|
|
797
723
|
}
|
|
798
724
|
};
|
|
799
|
-
|
|
800
725
|
var muteMic = function muteMic() {
|
|
801
726
|
var meeting = meetingRef.current;
|
|
802
|
-
|
|
803
727
|
if (meeting) {
|
|
804
728
|
meeting.muteMic();
|
|
805
729
|
}
|
|
806
730
|
};
|
|
807
|
-
|
|
808
731
|
var toggleMic = function toggleMic(customAudioTrack) {
|
|
809
732
|
if (customAudioTrack === void 0) {
|
|
810
733
|
customAudioTrack = undefined;
|
|
811
734
|
}
|
|
812
|
-
|
|
813
735
|
var localMicOn = localMicOnRef.current;
|
|
814
|
-
|
|
815
736
|
if (localMicOn) {
|
|
816
737
|
muteMic();
|
|
817
738
|
} else {
|
|
818
739
|
unmuteMic(customAudioTrack);
|
|
819
740
|
}
|
|
820
741
|
};
|
|
821
|
-
|
|
822
742
|
var disableWebcam = function disableWebcam() {
|
|
823
743
|
var meeting = meetingRef.current;
|
|
824
|
-
|
|
825
744
|
if (meeting) {
|
|
826
745
|
meeting.disableWebcam();
|
|
827
746
|
}
|
|
828
747
|
};
|
|
829
|
-
|
|
830
748
|
var enableWebcam = function enableWebcam(customVideoTrack) {
|
|
831
749
|
if (customVideoTrack === void 0) {
|
|
832
750
|
customVideoTrack = undefined;
|
|
833
751
|
}
|
|
834
|
-
|
|
835
752
|
var meeting = meetingRef.current;
|
|
836
|
-
|
|
837
753
|
if (meeting) {
|
|
838
754
|
meeting.enableWebcam(customVideoTrack);
|
|
839
755
|
}
|
|
840
756
|
};
|
|
841
|
-
|
|
842
757
|
var toggleWebcam = function toggleWebcam(customVideoTrack) {
|
|
843
758
|
if (customVideoTrack === void 0) {
|
|
844
759
|
customVideoTrack = undefined;
|
|
845
760
|
}
|
|
846
|
-
|
|
847
761
|
var localWebcamOn = localWebcamOnRef.current;
|
|
848
|
-
|
|
849
762
|
if (localWebcamOn) {
|
|
850
763
|
disableWebcam();
|
|
851
764
|
} else {
|
|
852
765
|
enableWebcam(customVideoTrack);
|
|
853
766
|
}
|
|
854
767
|
};
|
|
855
|
-
|
|
856
768
|
var disableScreenShare = function disableScreenShare() {
|
|
857
769
|
var meeting = meetingRef.current;
|
|
858
|
-
|
|
859
770
|
if (meeting) {
|
|
860
771
|
meeting.disableScreenShare();
|
|
861
772
|
}
|
|
862
773
|
};
|
|
863
|
-
|
|
864
774
|
var enableScreenShare = function enableScreenShare(customScreenShareTrack) {
|
|
865
775
|
if (customScreenShareTrack === void 0) {
|
|
866
776
|
customScreenShareTrack = undefined;
|
|
867
777
|
}
|
|
868
|
-
|
|
869
778
|
var meeting = meetingRef.current;
|
|
870
|
-
|
|
871
779
|
if (meeting) {
|
|
872
780
|
meeting.enableScreenShare(customScreenShareTrack);
|
|
873
781
|
}
|
|
874
782
|
};
|
|
875
|
-
|
|
876
783
|
var toggleScreenShare = function toggleScreenShare(customScreenShareTrack) {
|
|
877
784
|
if (customScreenShareTrack === void 0) {
|
|
878
785
|
customScreenShareTrack = undefined;
|
|
879
786
|
}
|
|
880
|
-
|
|
881
787
|
var localScreenShareOn = localScreenShareOnRef.current;
|
|
882
|
-
|
|
883
788
|
if (localScreenShareOn) {
|
|
884
789
|
disableScreenShare();
|
|
885
790
|
} else {
|
|
886
791
|
enableScreenShare(customScreenShareTrack);
|
|
887
792
|
}
|
|
888
793
|
};
|
|
889
|
-
|
|
890
794
|
var changeMode = function changeMode(mode) {
|
|
891
795
|
var meeting = meetingRef.current;
|
|
892
|
-
|
|
893
796
|
if (meeting) {
|
|
894
797
|
meeting.changeMode(mode);
|
|
895
798
|
}
|
|
896
799
|
};
|
|
897
|
-
|
|
898
800
|
var sendChatMessage = function sendChatMessage(text) {
|
|
899
801
|
var meeting = meetingRef.current;
|
|
900
|
-
|
|
901
802
|
if (meeting) {
|
|
902
803
|
meeting.sendChatMessage(text);
|
|
903
804
|
}
|
|
904
805
|
};
|
|
905
|
-
|
|
906
806
|
var respondEntry = function respondEntry(participantId, decision) {
|
|
907
807
|
var meeting = meetingRef.current;
|
|
908
|
-
|
|
909
808
|
if (meeting) {
|
|
910
809
|
meeting.respondEntry(participantId, decision);
|
|
911
810
|
}
|
|
912
811
|
};
|
|
913
|
-
|
|
914
812
|
var getMics = function getMics() {
|
|
915
813
|
try {
|
|
916
814
|
var _meeting = meetingRef.current;
|
|
@@ -923,7 +821,6 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
923
821
|
return Promise.reject(e);
|
|
924
822
|
}
|
|
925
823
|
};
|
|
926
|
-
|
|
927
824
|
var getWebcams = function getWebcams() {
|
|
928
825
|
try {
|
|
929
826
|
var _meeting2 = meetingRef.current;
|
|
@@ -936,95 +833,74 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
936
833
|
return Promise.reject(e);
|
|
937
834
|
}
|
|
938
835
|
};
|
|
939
|
-
|
|
940
836
|
var changeWebcam = function changeWebcam(obj) {
|
|
941
837
|
var meeting = meetingRef.current;
|
|
942
|
-
|
|
943
838
|
if (meeting) {
|
|
944
839
|
meeting.changeWebcam(obj);
|
|
945
840
|
}
|
|
946
841
|
};
|
|
947
|
-
|
|
948
842
|
var changeMic = function changeMic(obj) {
|
|
949
843
|
var meeting = meetingRef.current;
|
|
950
|
-
|
|
951
844
|
if (meeting) {
|
|
952
845
|
meeting.changeMic(obj);
|
|
953
846
|
}
|
|
954
847
|
};
|
|
955
|
-
|
|
956
848
|
var startVideo = function startVideo(_ref3) {
|
|
957
849
|
var link = _ref3.link;
|
|
958
850
|
var meeting = meetingRef.current;
|
|
959
|
-
|
|
960
851
|
if (meeting) {
|
|
961
852
|
meeting.startVideo({
|
|
962
853
|
link: link
|
|
963
854
|
});
|
|
964
855
|
}
|
|
965
856
|
};
|
|
966
|
-
|
|
967
857
|
var stopVideo = function stopVideo() {
|
|
968
858
|
var meeting = meetingRef.current;
|
|
969
|
-
|
|
970
859
|
if (meeting) {
|
|
971
860
|
meeting.stopVideo();
|
|
972
861
|
}
|
|
973
862
|
};
|
|
974
|
-
|
|
975
863
|
var resumeVideo = function resumeVideo() {
|
|
976
864
|
var meeting = meetingRef.current;
|
|
977
|
-
|
|
978
865
|
if (meeting) {
|
|
979
866
|
meeting.resumeVideo();
|
|
980
867
|
}
|
|
981
868
|
};
|
|
982
|
-
|
|
983
869
|
var pauseVideo = function pauseVideo(_ref4) {
|
|
984
870
|
var currentTime = _ref4.currentTime;
|
|
985
871
|
var meeting = meetingRef.current;
|
|
986
|
-
|
|
987
872
|
if (meeting) {
|
|
988
873
|
meeting.pauseVideo({
|
|
989
874
|
currentTime: currentTime
|
|
990
875
|
});
|
|
991
876
|
}
|
|
992
877
|
};
|
|
993
|
-
|
|
994
878
|
var seekVideo = function seekVideo(_ref5) {
|
|
995
879
|
var currentTime = _ref5.currentTime;
|
|
996
880
|
var meeting = meetingRef.current;
|
|
997
|
-
|
|
998
881
|
if (meeting) {
|
|
999
882
|
meeting.seekVideo({
|
|
1000
883
|
currentTime: currentTime
|
|
1001
884
|
});
|
|
1002
885
|
}
|
|
1003
886
|
};
|
|
1004
|
-
|
|
1005
887
|
var startLivestream = function startLivestream(streamInfo, config) {
|
|
1006
888
|
var meeting = meetingRef.current;
|
|
1007
|
-
|
|
1008
889
|
if (meeting) {
|
|
1009
890
|
meeting.startLivestream(streamInfo, config);
|
|
1010
891
|
}
|
|
1011
892
|
};
|
|
1012
|
-
|
|
1013
893
|
var stopLivestream = function stopLivestream() {
|
|
1014
894
|
var meeting = meetingRef.current;
|
|
1015
|
-
|
|
1016
895
|
if (meeting) {
|
|
1017
896
|
meeting.stopLivestream();
|
|
1018
897
|
}
|
|
1019
898
|
};
|
|
1020
|
-
|
|
1021
899
|
var connectTo = function connectTo(_ref6) {
|
|
1022
900
|
var meetingId = _ref6.meetingId,
|
|
1023
|
-
|
|
1024
|
-
|
|
901
|
+
payload = _ref6.payload;
|
|
1025
902
|
try {
|
|
1026
903
|
var _meeting3 = meetingRef.current;
|
|
1027
|
-
|
|
1028
904
|
var _temp2 = function () {
|
|
1029
905
|
if (_meeting3) {
|
|
1030
906
|
return Promise.resolve(_meeting3.connectTo({
|
|
@@ -1033,32 +909,25 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1033
909
|
})).then(function () {});
|
|
1034
910
|
}
|
|
1035
911
|
}();
|
|
1036
|
-
|
|
1037
912
|
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
1038
913
|
} catch (e) {
|
|
1039
914
|
return Promise.reject(e);
|
|
1040
915
|
}
|
|
1041
916
|
};
|
|
1042
|
-
|
|
1043
917
|
var startHls = function startHls(config) {
|
|
1044
918
|
var meeting = meetingRef.current;
|
|
1045
|
-
|
|
1046
919
|
if (meeting) {
|
|
1047
920
|
meeting.startHls(config);
|
|
1048
921
|
}
|
|
1049
922
|
};
|
|
1050
|
-
|
|
1051
923
|
var stopHls = function stopHls() {
|
|
1052
924
|
var meeting = meetingRef.current;
|
|
1053
|
-
|
|
1054
925
|
if (meeting) {
|
|
1055
926
|
meeting.stopHls();
|
|
1056
927
|
}
|
|
1057
928
|
};
|
|
1058
|
-
|
|
1059
929
|
var initSDK = function initSDK() {
|
|
1060
930
|
jsSdk.VideoSDK.config(tokenRef.current);
|
|
1061
|
-
|
|
1062
931
|
if (deviceInfo) {
|
|
1063
932
|
jsSdk.VideoSDK.analytics(deviceInfo);
|
|
1064
933
|
} else {
|
|
@@ -1067,12 +936,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1067
936
|
sdkVersion: version
|
|
1068
937
|
});
|
|
1069
938
|
}
|
|
1070
|
-
|
|
1071
939
|
if (joinWithoutUserInteraction) {
|
|
1072
940
|
join();
|
|
1073
941
|
}
|
|
1074
942
|
};
|
|
1075
|
-
|
|
1076
943
|
React.useEffect(function () {
|
|
1077
944
|
initSDK();
|
|
1078
945
|
}, []);
|
|
@@ -1143,260 +1010,198 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1143
1010
|
|
|
1144
1011
|
var useParticipant = function useParticipant(participantId, _temp) {
|
|
1145
1012
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1013
|
+
_ref$onStreamEnabled = _ref.onStreamEnabled,
|
|
1014
|
+
onStreamEnabled = _ref$onStreamEnabled === void 0 ? function () {} : _ref$onStreamEnabled,
|
|
1015
|
+
_ref$onStreamDisabled = _ref.onStreamDisabled,
|
|
1016
|
+
onStreamDisabled = _ref$onStreamDisabled === void 0 ? function () {} : _ref$onStreamDisabled,
|
|
1017
|
+
_ref$onMediaStatusCha = _ref.onMediaStatusChanged,
|
|
1018
|
+
onMediaStatusChanged = _ref$onMediaStatusCha === void 0 ? function () {} : _ref$onMediaStatusCha,
|
|
1019
|
+
_ref$onVideoQualityCh = _ref.onVideoQualityChanged,
|
|
1020
|
+
onVideoQualityChanged = _ref$onVideoQualityCh === void 0 ? function () {} : _ref$onVideoQualityCh;
|
|
1155
1021
|
var _useState = React.useState(null),
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1022
|
+
webcamStream = _useState[0],
|
|
1023
|
+
setwebcamStream = _useState[1];
|
|
1159
1024
|
var _useState2 = React.useState(null),
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1025
|
+
micStream = _useState2[0],
|
|
1026
|
+
setMicStream = _useState2[1];
|
|
1163
1027
|
var _useState3 = React.useState(null),
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1028
|
+
screenShareStream = _useState3[0],
|
|
1029
|
+
setScreenShareStream = _useState3[1];
|
|
1167
1030
|
var _useState4 = React.useState(null),
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1031
|
+
screenShareAudioStream = _useState4[0],
|
|
1032
|
+
setScreenShareAudioStream = _useState4[1];
|
|
1171
1033
|
var meeting = useMeeting();
|
|
1172
|
-
|
|
1173
1034
|
var _useMemo = React.useMemo(function () {
|
|
1174
|
-
|
|
1035
|
+
var _meeting$pinnedPartic;
|
|
1036
|
+
var participants = meeting === null || meeting === void 0 ? void 0 : meeting.participants;
|
|
1037
|
+
var localParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.localParticipant;
|
|
1038
|
+
var activeSpeakerId = meeting === null || meeting === void 0 ? void 0 : meeting.activeSpeakerId;
|
|
1039
|
+
var mainParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.mainParticipant;
|
|
1040
|
+
var pinState = (meeting === null || meeting === void 0 ? void 0 : (_meeting$pinnedPartic = meeting.pinnedParticipants) === null || _meeting$pinnedPartic === void 0 ? void 0 : _meeting$pinnedPartic.get(participantId)) || {
|
|
1041
|
+
cam: false,
|
|
1042
|
+
share: false
|
|
1043
|
+
};
|
|
1175
1044
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
pinState: pinState
|
|
1190
|
-
};
|
|
1191
|
-
}, [meeting]),
|
|
1192
|
-
participants = _useMemo.participants,
|
|
1193
|
-
localParticipant = _useMemo.localParticipant,
|
|
1194
|
-
activeSpeakerId = _useMemo.activeSpeakerId,
|
|
1195
|
-
mainParticipant = _useMemo.mainParticipant,
|
|
1196
|
-
pinState = _useMemo.pinState;
|
|
1045
|
+
return {
|
|
1046
|
+
participants: participants,
|
|
1047
|
+
localParticipant: localParticipant,
|
|
1048
|
+
activeSpeakerId: activeSpeakerId,
|
|
1049
|
+
mainParticipant: mainParticipant,
|
|
1050
|
+
pinState: pinState
|
|
1051
|
+
};
|
|
1052
|
+
}, [meeting]),
|
|
1053
|
+
participants = _useMemo.participants,
|
|
1054
|
+
localParticipant = _useMemo.localParticipant,
|
|
1055
|
+
activeSpeakerId = _useMemo.activeSpeakerId,
|
|
1056
|
+
mainParticipant = _useMemo.mainParticipant,
|
|
1057
|
+
pinState = _useMemo.pinState;
|
|
1197
1058
|
|
|
1198
1059
|
var participant = participants === null || participants === void 0 ? void 0 : participants.get(participantId);
|
|
1199
|
-
|
|
1200
1060
|
var _useState5 = React.useState(participant === null || participant === void 0 ? void 0 : participant.webcamOn),
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1061
|
+
webcamOn = _useState5[0],
|
|
1062
|
+
setWebcamOn = _useState5[1];
|
|
1204
1063
|
var _useState6 = React.useState(participant === null || participant === void 0 ? void 0 : participant.micOn),
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1064
|
+
micOn = _useState6[0],
|
|
1065
|
+
setMicOn = _useState6[1];
|
|
1208
1066
|
var _useState7 = React.useState(participant === null || participant === void 0 ? void 0 : participant.mode),
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1067
|
+
mode = _useState7[0],
|
|
1068
|
+
setMode = _useState7[1];
|
|
1212
1069
|
var setTrack = function setTrack(stream) {
|
|
1213
1070
|
if (stream.track.readyState === 'live') {
|
|
1214
1071
|
switch (stream.kind) {
|
|
1215
1072
|
case 'video':
|
|
1216
|
-
if (webcamStream != null) {
|
|
1217
|
-
setwebcamStream(null);
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
1073
|
setwebcamStream(stream);
|
|
1221
1074
|
break;
|
|
1222
|
-
|
|
1223
1075
|
case 'audio':
|
|
1224
|
-
if (micStream != null) {
|
|
1225
|
-
setMicStream(null);
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
1076
|
setMicStream(stream);
|
|
1229
1077
|
break;
|
|
1230
|
-
|
|
1231
1078
|
case 'share':
|
|
1232
|
-
if (screenShareStream != null) {
|
|
1233
|
-
setScreenShareStream(null);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
1079
|
setScreenShareStream(stream);
|
|
1237
1080
|
break;
|
|
1238
|
-
|
|
1239
1081
|
case 'shareAudio':
|
|
1240
|
-
if (screenShareAudioStream != null) {
|
|
1241
|
-
setScreenShareAudioStream(null);
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
1082
|
setScreenShareAudioStream(stream);
|
|
1245
1083
|
break;
|
|
1246
1084
|
}
|
|
1247
1085
|
}
|
|
1248
1086
|
};
|
|
1249
|
-
|
|
1250
1087
|
var unSetTrack = function unSetTrack(stream) {
|
|
1251
1088
|
if (stream.track.readyState !== 'live') {
|
|
1252
1089
|
switch (stream.kind) {
|
|
1253
1090
|
case 'video':
|
|
1254
1091
|
setwebcamStream(null);
|
|
1255
1092
|
break;
|
|
1256
|
-
|
|
1257
1093
|
case 'audio':
|
|
1258
1094
|
setMicStream(null);
|
|
1259
1095
|
break;
|
|
1260
|
-
|
|
1261
1096
|
case 'share':
|
|
1262
1097
|
setScreenShareStream(null);
|
|
1263
1098
|
break;
|
|
1264
|
-
|
|
1265
1099
|
case 'shareAudio':
|
|
1266
1100
|
setScreenShareAudioStream(null);
|
|
1267
1101
|
break;
|
|
1268
1102
|
}
|
|
1269
1103
|
}
|
|
1270
1104
|
};
|
|
1271
|
-
|
|
1272
1105
|
var _handleStreamEnabled = function _handleStreamEnabled(stream) {
|
|
1273
1106
|
setTrack(stream);
|
|
1274
1107
|
onStreamEnabled(stream);
|
|
1275
1108
|
};
|
|
1276
|
-
|
|
1277
1109
|
var _handleParticipantModeChanged = function _handleParticipantModeChanged(data) {
|
|
1278
1110
|
console.log('## FINAL', data);
|
|
1279
|
-
|
|
1280
1111
|
if (participantId === data.participantId) {
|
|
1281
1112
|
setMode(data.mode);
|
|
1282
1113
|
}
|
|
1283
1114
|
};
|
|
1284
|
-
|
|
1285
1115
|
var _handleStreamDisabled = function _handleStreamDisabled(stream) {
|
|
1286
1116
|
unSetTrack(stream);
|
|
1287
1117
|
onStreamDisabled(stream);
|
|
1288
1118
|
};
|
|
1289
|
-
|
|
1290
1119
|
var _handleVideoQualityChanged = function _handleVideoQualityChanged(data) {
|
|
1291
1120
|
var peerId = data.peerId,
|
|
1292
|
-
|
|
1293
|
-
|
|
1121
|
+
prevQuality = data.prevQuality,
|
|
1122
|
+
currentQuality = data.currentQuality;
|
|
1294
1123
|
onVideoQualityChanged({
|
|
1295
1124
|
peerId: peerId,
|
|
1296
1125
|
prevQuality: prevQuality,
|
|
1297
1126
|
currentQuality: currentQuality
|
|
1298
1127
|
});
|
|
1299
1128
|
};
|
|
1300
|
-
|
|
1301
1129
|
var _handleMediaStatusChanged = function _handleMediaStatusChanged(data) {
|
|
1302
1130
|
var kind = data.kind,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1131
|
+
peerId = data.peerId,
|
|
1132
|
+
newStatus = data.newStatus;
|
|
1306
1133
|
if (kind == 'audio') {
|
|
1307
1134
|
setMicOn(newStatus);
|
|
1308
1135
|
} else if (kind == 'video') {
|
|
1309
1136
|
setWebcamOn(newStatus);
|
|
1310
1137
|
}
|
|
1311
|
-
|
|
1312
1138
|
onMediaStatusChanged({
|
|
1313
1139
|
kind: kind,
|
|
1314
1140
|
peerId: peerId,
|
|
1315
1141
|
newStatus: newStatus
|
|
1316
1142
|
});
|
|
1317
1143
|
};
|
|
1318
|
-
|
|
1319
1144
|
var setQuality = function setQuality(quality) {
|
|
1320
1145
|
participant === null || participant === void 0 ? void 0 : participant.setQuality(quality);
|
|
1321
1146
|
};
|
|
1322
|
-
|
|
1323
1147
|
var setViewPort = function setViewPort(width, height) {
|
|
1324
1148
|
participant === null || participant === void 0 ? void 0 : participant.setViewPort(width, height);
|
|
1325
1149
|
};
|
|
1326
|
-
|
|
1327
1150
|
var enableMic = function enableMic() {
|
|
1328
1151
|
participant === null || participant === void 0 ? void 0 : participant.enableMic();
|
|
1329
1152
|
};
|
|
1330
|
-
|
|
1331
1153
|
var disableMic = function disableMic() {
|
|
1332
1154
|
participant === null || participant === void 0 ? void 0 : participant.disableMic();
|
|
1333
1155
|
};
|
|
1334
|
-
|
|
1335
1156
|
var enableWebcam = function enableWebcam() {
|
|
1336
1157
|
participant === null || participant === void 0 ? void 0 : participant.enableWebcam();
|
|
1337
1158
|
};
|
|
1338
|
-
|
|
1339
1159
|
var disableWebcam = function disableWebcam() {
|
|
1340
1160
|
participant === null || participant === void 0 ? void 0 : participant.disableWebcam();
|
|
1341
1161
|
};
|
|
1342
|
-
|
|
1343
1162
|
var pin = function pin(data) {
|
|
1344
1163
|
participant === null || participant === void 0 ? void 0 : participant.pin(data);
|
|
1345
1164
|
};
|
|
1346
|
-
|
|
1347
1165
|
var unpin = function unpin(data) {
|
|
1348
1166
|
participant === null || participant === void 0 ? void 0 : participant.unpin(data);
|
|
1349
1167
|
};
|
|
1350
|
-
|
|
1351
1168
|
var getAudioStats = function getAudioStats() {
|
|
1352
1169
|
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats());
|
|
1353
1170
|
};
|
|
1354
|
-
|
|
1355
1171
|
var getVideoStats = function getVideoStats() {
|
|
1356
1172
|
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getVideoStats());
|
|
1357
1173
|
};
|
|
1358
|
-
|
|
1359
1174
|
var getShareStats = function getShareStats() {
|
|
1360
1175
|
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getShareStats());
|
|
1361
1176
|
};
|
|
1362
|
-
|
|
1363
1177
|
var consumeWebcamStreams = function consumeWebcamStreams() {
|
|
1364
1178
|
participant === null || participant === void 0 ? void 0 : participant.consumeWebcamStreams();
|
|
1365
1179
|
};
|
|
1366
|
-
|
|
1367
1180
|
var consumeMicStreams = function consumeMicStreams() {
|
|
1368
1181
|
participant === null || participant === void 0 ? void 0 : participant.consumeMicStreams();
|
|
1369
1182
|
};
|
|
1370
|
-
|
|
1371
1183
|
var stopConsumingWebcamStreams = function stopConsumingWebcamStreams() {
|
|
1372
1184
|
participant === null || participant === void 0 ? void 0 : participant.stopConsumingWebcamStreams();
|
|
1373
1185
|
};
|
|
1374
|
-
|
|
1375
1186
|
var stopConsumingMicStreams = function stopConsumingMicStreams() {
|
|
1376
1187
|
participant === null || participant === void 0 ? void 0 : participant.stopConsumingMicStreams();
|
|
1377
1188
|
};
|
|
1378
|
-
|
|
1379
1189
|
var switchTo = function switchTo(data) {
|
|
1380
1190
|
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.switchTo(data)).then(function () {});
|
|
1381
1191
|
};
|
|
1382
|
-
|
|
1383
1192
|
React.useEffect(function () {
|
|
1384
1193
|
var streams = participant === null || participant === void 0 ? void 0 : participant.streams;
|
|
1385
|
-
|
|
1386
1194
|
if (streams) {
|
|
1387
1195
|
streams.forEach(function (stream) {
|
|
1388
1196
|
setTrack(stream);
|
|
1389
1197
|
});
|
|
1390
1198
|
}
|
|
1391
|
-
|
|
1392
1199
|
if (participant !== null && participant !== void 0 && participant.micOn) {
|
|
1393
1200
|
setMicOn(micOn);
|
|
1394
1201
|
}
|
|
1395
|
-
|
|
1396
1202
|
if (participant !== null && participant !== void 0 && participant.webcamOn) {
|
|
1397
1203
|
setWebcamOn(webcamOn);
|
|
1398
1204
|
}
|
|
1399
|
-
|
|
1400
1205
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled);
|
|
1401
1206
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled);
|
|
1402
1207
|
participant === null || participant === void 0 ? void 0 : participant.on('media-status-changed', _handleMediaStatusChanged);
|
|
@@ -1446,39 +1251,33 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1446
1251
|
|
|
1447
1252
|
var useConnection = function useConnection(connectionId, _temp) {
|
|
1448
1253
|
var _ref = _temp === void 0 ? {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1254
|
+
onMeeting: {
|
|
1255
|
+
onParticipantJoined: function onParticipantJoined() {},
|
|
1256
|
+
onParticipantLeft: function onParticipantLeft() {},
|
|
1257
|
+
onChatMessage: function onChatMessage() {}
|
|
1258
|
+
}
|
|
1259
|
+
} : _temp,
|
|
1260
|
+
onMeeting = _ref.onMeeting;
|
|
1457
1261
|
var onParticipantJoined = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantJoined;
|
|
1458
1262
|
var onParticipantLeft = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantLeft;
|
|
1459
1263
|
var onChatMessage = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onChatMessage;
|
|
1460
1264
|
var meeting = useMeeting();
|
|
1461
|
-
|
|
1462
1265
|
var _useMemo = React.useMemo(function () {
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
connection = _useMemo.connection,
|
|
1476
|
-
connectionParticipants = _useMemo.connectionParticipants;
|
|
1477
|
-
|
|
1266
|
+
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId);
|
|
1267
|
+
if (!connection) {
|
|
1268
|
+
throw new Error('connectionId not found');
|
|
1269
|
+
}
|
|
1270
|
+
var connectionParticipants = new Map(connection.meeting.participants);
|
|
1271
|
+
return {
|
|
1272
|
+
connection: connection,
|
|
1273
|
+
connectionParticipants: connectionParticipants
|
|
1274
|
+
};
|
|
1275
|
+
}, [meeting]),
|
|
1276
|
+
connection = _useMemo.connection,
|
|
1277
|
+
connectionParticipants = _useMemo.connectionParticipants;
|
|
1478
1278
|
var _useState = React.useState(new Map(connectionParticipants)),
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1279
|
+
_connectionParticipants = _useState[0],
|
|
1280
|
+
setConnectionParticipants = _useState[1];
|
|
1482
1281
|
var _handleParticipantJoined = function _handleParticipantJoined(participant) {
|
|
1483
1282
|
setConnectionParticipants(function (s) {
|
|
1484
1283
|
s.set(participant.id, participant);
|
|
@@ -1487,7 +1286,6 @@ var useConnection = function useConnection(connectionId, _temp) {
|
|
|
1487
1286
|
});
|
|
1488
1287
|
onParticipantJoined(participant);
|
|
1489
1288
|
};
|
|
1490
|
-
|
|
1491
1289
|
var _handleParticipantLeft = function _handleParticipantLeft(participantId) {
|
|
1492
1290
|
setConnectionParticipants(function (s) {
|
|
1493
1291
|
s["delete"](participantId);
|
|
@@ -1496,11 +1294,9 @@ var useConnection = function useConnection(connectionId, _temp) {
|
|
|
1496
1294
|
});
|
|
1497
1295
|
onParticipantLeft(participantId);
|
|
1498
1296
|
};
|
|
1499
|
-
|
|
1500
1297
|
var _handleChatMessage = function _handleChatMessage(data) {
|
|
1501
1298
|
onChatMessage(data);
|
|
1502
1299
|
};
|
|
1503
|
-
|
|
1504
1300
|
React.useEffect(function () {
|
|
1505
1301
|
connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-joined', _handleParticipantJoined);
|
|
1506
1302
|
connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-left', _handleParticipantLeft);
|
|
@@ -1528,19 +1324,16 @@ var useConnection = function useConnection(connectionId, _temp) {
|
|
|
1528
1324
|
|
|
1529
1325
|
var usePubSub = function usePubSub(topic, _temp) {
|
|
1530
1326
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1327
|
+
_ref$onMessageReceive = _ref.onMessageReceived,
|
|
1328
|
+
onMessageReceived = _ref$onMessageReceive === void 0 ? function () {} : _ref$onMessageReceive,
|
|
1329
|
+
_ref$onOldMessagesRec = _ref.onOldMessagesReceived,
|
|
1330
|
+
onOldMessagesReceived = _ref$onOldMessagesRec === void 0 ? function () {} : _ref$onOldMessagesRec;
|
|
1536
1331
|
var _useMeeting = useMeeting(),
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1332
|
+
meeting = _useMeeting.meeting,
|
|
1333
|
+
isMeetingJoined = _useMeeting.isMeetingJoined;
|
|
1540
1334
|
var _useState = React.useState([]),
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1335
|
+
messages = _useState[0],
|
|
1336
|
+
setMessages = _useState[1];
|
|
1544
1337
|
var isSubscribed = React.useRef(false);
|
|
1545
1338
|
|
|
1546
1339
|
var publish = function publish(message, options) {
|
|
@@ -1548,18 +1341,15 @@ var usePubSub = function usePubSub(topic, _temp) {
|
|
|
1548
1341
|
meeting.pubSub.publish(topic, message, options);
|
|
1549
1342
|
}
|
|
1550
1343
|
};
|
|
1551
|
-
|
|
1552
1344
|
var _handlePubSub = function _handlePubSub(data) {
|
|
1553
1345
|
setMessages(function (s) {
|
|
1554
1346
|
return [].concat(s, [data]);
|
|
1555
1347
|
});
|
|
1556
1348
|
onMessageReceived(data);
|
|
1557
1349
|
};
|
|
1558
|
-
|
|
1559
1350
|
var subscribeToPubsub = function subscribeToPubsub(meeting) {
|
|
1560
1351
|
try {
|
|
1561
1352
|
var _meeting$pubSub;
|
|
1562
|
-
|
|
1563
1353
|
return Promise.resolve(meeting === null || meeting === void 0 ? void 0 : (_meeting$pubSub = meeting.pubSub) === null || _meeting$pubSub === void 0 ? void 0 : _meeting$pubSub.subscribe(topic, _handlePubSub)).then(function (data) {
|
|
1564
1354
|
if (data) {
|
|
1565
1355
|
onOldMessagesReceived(data.messages);
|
|
@@ -1570,14 +1360,12 @@ var usePubSub = function usePubSub(topic, _temp) {
|
|
|
1570
1360
|
return Promise.reject(e);
|
|
1571
1361
|
}
|
|
1572
1362
|
};
|
|
1573
|
-
|
|
1574
1363
|
React.useEffect(function () {
|
|
1575
1364
|
if (meeting && !isSubscribed.current && isMeetingJoined) {
|
|
1576
1365
|
isSubscribed.current = true;
|
|
1577
1366
|
subscribeToPubsub(meeting);
|
|
1578
1367
|
return function () {
|
|
1579
1368
|
var _meeting$pubSub2;
|
|
1580
|
-
|
|
1581
1369
|
meeting === null || meeting === void 0 ? void 0 : (_meeting$pubSub2 = meeting.pubSub) === null || _meeting$pubSub2 === void 0 ? void 0 : _meeting$pubSub2.unsubscribe(topic, _handlePubSub);
|
|
1582
1370
|
};
|
|
1583
1371
|
}
|
|
@@ -1592,16 +1380,15 @@ var Constants = jsSdk.VideoSDK.Constants;
|
|
|
1592
1380
|
|
|
1593
1381
|
var createCameraVideoTrack = function createCameraVideoTrack(_ref) {
|
|
1594
1382
|
var _ref$cameraId = _ref.cameraId,
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1383
|
+
cameraId = _ref$cameraId === void 0 ? undefined : _ref$cameraId,
|
|
1384
|
+
_ref$encoderConfig = _ref.encoderConfig,
|
|
1385
|
+
encoderConfig = _ref$encoderConfig === void 0 ? undefined : _ref$encoderConfig,
|
|
1386
|
+
_ref$facingMode = _ref.facingMode,
|
|
1387
|
+
facingMode = _ref$facingMode === void 0 ? undefined : _ref$facingMode,
|
|
1388
|
+
_ref$optimizationMode = _ref.optimizationMode,
|
|
1389
|
+
optimizationMode = _ref$optimizationMode === void 0 ? undefined : _ref$optimizationMode,
|
|
1390
|
+
_ref$multiStream = _ref.multiStream,
|
|
1391
|
+
multiStream = _ref$multiStream === void 0 ? true : _ref$multiStream;
|
|
1605
1392
|
try {
|
|
1606
1393
|
return Promise.resolve(jsSdk.VideoSDK.createCameraVideoTrack({
|
|
1607
1394
|
cameraId: cameraId,
|
|
@@ -1617,12 +1404,11 @@ var createCameraVideoTrack = function createCameraVideoTrack(_ref) {
|
|
|
1617
1404
|
|
|
1618
1405
|
var createScreenShareVideoTrack = function createScreenShareVideoTrack(_ref2) {
|
|
1619
1406
|
var _ref2$encoderConfig = _ref2.encoderConfig,
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1407
|
+
encoderConfig = _ref2$encoderConfig === void 0 ? undefined : _ref2$encoderConfig,
|
|
1408
|
+
_ref2$optimizationMod = _ref2.optimizationMode,
|
|
1409
|
+
optimizationMode = _ref2$optimizationMod === void 0 ? undefined : _ref2$optimizationMod,
|
|
1410
|
+
_ref2$withAudio = _ref2.withAudio,
|
|
1411
|
+
withAudio = _ref2$withAudio === void 0 ? 'enable' : _ref2$withAudio;
|
|
1626
1412
|
try {
|
|
1627
1413
|
return Promise.resolve(jsSdk.VideoSDK.createScreenShareVideoTrack({
|
|
1628
1414
|
encoderConfig: encoderConfig,
|
|
@@ -1636,12 +1422,11 @@ var createScreenShareVideoTrack = function createScreenShareVideoTrack(_ref2) {
|
|
|
1636
1422
|
|
|
1637
1423
|
var createMicrophoneAudioTrack = function createMicrophoneAudioTrack(_ref3) {
|
|
1638
1424
|
var _ref3$noiseConfig = _ref3.noiseConfig,
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1425
|
+
noiseConfig = _ref3$noiseConfig === void 0 ? undefined : _ref3$noiseConfig,
|
|
1426
|
+
_ref3$encoderConfig = _ref3.encoderConfig,
|
|
1427
|
+
encoderConfig = _ref3$encoderConfig === void 0 ? undefined : _ref3$encoderConfig,
|
|
1428
|
+
_ref3$microphoneId = _ref3.microphoneId,
|
|
1429
|
+
microphoneId = _ref3$microphoneId === void 0 ? undefined : _ref3$microphoneId;
|
|
1645
1430
|
try {
|
|
1646
1431
|
return Promise.resolve(jsSdk.VideoSDK.createMicrophoneAudioTrack({
|
|
1647
1432
|
noiseConfig: noiseConfig,
|