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