@videosdk.live/react-sdk 0.4.1 → 0.4.3
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 +119 -90
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +119 -90
- package/dist/index.modern.js.map +1 -1
- package/dist/types/connectionMeeting.d.ts +2 -2
- package/dist/types/index.d.ts +15 -12
- package/dist/types/meeting.d.ts +20 -13
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -62,7 +62,7 @@ var events = {
|
|
|
62
62
|
'entry-responded': eventPrifix + "-entry-responded",
|
|
63
63
|
'recording-started': eventPrifix + "-recording-started",
|
|
64
64
|
'recording-stopped': eventPrifix + "-recording-stopped",
|
|
65
|
-
|
|
65
|
+
data: eventPrifix + "-data",
|
|
66
66
|
'meeting-joined': eventPrifix + "-meeting-joined",
|
|
67
67
|
'meeting-left': eventPrifix + "-meeting-left",
|
|
68
68
|
'live-stream-started': eventPrifix + "-live-stream-started",
|
|
@@ -139,8 +139,8 @@ var useMeeting = function useMeeting(_temp) {
|
|
|
139
139
|
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart,
|
|
140
140
|
_ref$onRecordingStopp = _ref.onRecordingStopped,
|
|
141
141
|
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp,
|
|
142
|
-
_ref$
|
|
143
|
-
|
|
142
|
+
_ref$onData = _ref.onData,
|
|
143
|
+
onData = _ref$onData === void 0 ? function () {} : _ref$onData,
|
|
144
144
|
_ref$onMeetingJoined = _ref.onMeetingJoined,
|
|
145
145
|
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined,
|
|
146
146
|
_ref$onMeetingLeft = _ref.onMeetingLeft,
|
|
@@ -207,7 +207,7 @@ var useMeeting = function useMeeting(_temp) {
|
|
|
207
207
|
eventEmitter.on(events['resumed-all-streams'], onResumedAllStreams);
|
|
208
208
|
eventEmitter.on(events['recording-started'], onRecordingStarted);
|
|
209
209
|
eventEmitter.on(events['recording-stopped'], onRecordingStopped);
|
|
210
|
-
eventEmitter.on(events['
|
|
210
|
+
eventEmitter.on(events['data'], onData);
|
|
211
211
|
eventEmitter.on(events['meeting-joined'], onMeetingJoined);
|
|
212
212
|
eventEmitter.on(events['meeting-left'], onMeetingLeft);
|
|
213
213
|
eventEmitter.on(events['live-stream-started'], onLiveStreamStarted);
|
|
@@ -248,7 +248,7 @@ var useMeeting = function useMeeting(_temp) {
|
|
|
248
248
|
eventEmitter.off(events['resumed-all-streams'], onResumedAllStreams);
|
|
249
249
|
eventEmitter.off(events['recording-started'], onRecordingStarted);
|
|
250
250
|
eventEmitter.off(events['recording-stopped'], onRecordingStopped);
|
|
251
|
-
eventEmitter.off(events['
|
|
251
|
+
eventEmitter.off(events['data'], onData);
|
|
252
252
|
eventEmitter.off(events['meeting-joined'], onMeetingJoined);
|
|
253
253
|
eventEmitter.off(events['meeting-left'], onMeetingLeft);
|
|
254
254
|
eventEmitter.off(events['live-stream-started'], onLiveStreamStarted);
|
|
@@ -303,8 +303,8 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
303
303
|
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar,
|
|
304
304
|
_ref2$onRecordingStop = _ref2.onRecordingStopped,
|
|
305
305
|
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop,
|
|
306
|
-
_ref2$
|
|
307
|
-
|
|
306
|
+
_ref2$onData = _ref2.onData,
|
|
307
|
+
onData = _ref2$onData === void 0 ? function () {} : _ref2$onData,
|
|
308
308
|
_ref2$onMeetingJoined = _ref2.onMeetingJoined,
|
|
309
309
|
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined,
|
|
310
310
|
_ref2$onMeetingLeft = _ref2.onMeetingLeft,
|
|
@@ -372,7 +372,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
372
372
|
eventEmitter.on(events['resumed-all-streams'], onResumedAllStreams);
|
|
373
373
|
eventEmitter.on(events['recording-started'], onRecordingStarted);
|
|
374
374
|
eventEmitter.on(events['recording-stopped'], onRecordingStopped);
|
|
375
|
-
eventEmitter.on(events['
|
|
375
|
+
eventEmitter.on(events['data'], onData);
|
|
376
376
|
eventEmitter.on(events['meeting-joined'], onMeetingJoined);
|
|
377
377
|
eventEmitter.on(events['meeting-left'], onMeetingLeft);
|
|
378
378
|
eventEmitter.on(events['live-stream-enabled'], onLiveStreamStarted);
|
|
@@ -412,7 +412,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
412
412
|
eventEmitter.off(events['resumed-all-streams'], onResumedAllStreams);
|
|
413
413
|
eventEmitter.off(events['recording-started'], onRecordingStarted);
|
|
414
414
|
eventEmitter.off(events['recording-stopped'], onRecordingStopped);
|
|
415
|
-
eventEmitter.off(events['
|
|
415
|
+
eventEmitter.off(events['data'], onData);
|
|
416
416
|
eventEmitter.off(events['meeting-joined'], onMeetingJoined);
|
|
417
417
|
eventEmitter.off(events['meeting-left'], onMeetingLeft);
|
|
418
418
|
eventEmitter.off(events['live-stream-enabled'], onLiveStreamStarted);
|
|
@@ -444,7 +444,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
444
444
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
|
|
445
445
|
};
|
|
446
446
|
|
|
447
|
-
var version = "0.4.
|
|
447
|
+
var version = "0.4.3";
|
|
448
448
|
|
|
449
449
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
450
450
|
var children = _ref.children,
|
|
@@ -481,49 +481,49 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
481
481
|
var _useState9 = useState(false),
|
|
482
482
|
isRecording = _useState9[0],
|
|
483
483
|
setIsRecording = _useState9[1];
|
|
484
|
-
var
|
|
485
|
-
messages =
|
|
486
|
-
setMessages =
|
|
484
|
+
var _useState0 = useState([]),
|
|
485
|
+
messages = _useState0[0],
|
|
486
|
+
setMessages = _useState0[1];
|
|
487
|
+
var _useState1 = useState(new Map()),
|
|
488
|
+
participants = _useState1[0],
|
|
489
|
+
setParticipants = _useState1[1];
|
|
490
|
+
var _useState10 = useState(new Map()),
|
|
491
|
+
characters = _useState10[0],
|
|
492
|
+
setCharacters = _useState10[1];
|
|
487
493
|
var _useState11 = useState(new Map()),
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
var _useState12 = useState(
|
|
491
|
-
|
|
492
|
-
|
|
494
|
+
pinnedParticipants = _useState11[0],
|
|
495
|
+
setPinnedParticipants = _useState11[1];
|
|
496
|
+
var _useState12 = useState(false),
|
|
497
|
+
isLiveStreaming = _useState12[0],
|
|
498
|
+
setIsLiveStreaming = _useState12[1];
|
|
493
499
|
var _useState13 = useState(new Map()),
|
|
494
|
-
|
|
495
|
-
|
|
500
|
+
connections = _useState13[0],
|
|
501
|
+
setConnections = _useState13[1];
|
|
496
502
|
var _useState14 = useState(false),
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
var _useState15 = useState(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
var _useState16 = useState(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
var _useState17 = useState(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
var _useState18 = useState('
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
var _useState19 = useState(
|
|
512
|
-
livestreamState = _useState19[0],
|
|
513
|
-
setLivestreamState = _useState19[1];
|
|
514
|
-
var _useState20 = useState('HLS_STOPPED'),
|
|
515
|
-
hlsState = _useState20[0],
|
|
516
|
-
setHlsState = _useState20[1];
|
|
517
|
-
var _useState21 = useState({
|
|
503
|
+
isMeetingJoined = _useState14[0],
|
|
504
|
+
setIsMeetingJoined = _useState14[1];
|
|
505
|
+
var _useState15 = useState(false),
|
|
506
|
+
isHls = _useState15[0],
|
|
507
|
+
setIsHls = _useState15[1];
|
|
508
|
+
var _useState16 = useState('RECORDING_STOPPED'),
|
|
509
|
+
recordingState = _useState16[0],
|
|
510
|
+
setRecordingState = _useState16[1];
|
|
511
|
+
var _useState17 = useState('LIVESTREAM_STOPPED'),
|
|
512
|
+
livestreamState = _useState17[0],
|
|
513
|
+
setLivestreamState = _useState17[1];
|
|
514
|
+
var _useState18 = useState('HLS_STOPPED'),
|
|
515
|
+
hlsState = _useState18[0],
|
|
516
|
+
setHlsState = _useState18[1];
|
|
517
|
+
var _useState19 = useState({
|
|
518
518
|
downstreamUrl: null,
|
|
519
519
|
playbackHlsUrl: null,
|
|
520
520
|
livestreamUrl: null
|
|
521
521
|
}),
|
|
522
|
-
hlsUrls =
|
|
523
|
-
setHlsUrls =
|
|
524
|
-
var
|
|
525
|
-
transcriptionState =
|
|
526
|
-
setTranscriptionState =
|
|
522
|
+
hlsUrls = _useState19[0],
|
|
523
|
+
setHlsUrls = _useState19[1];
|
|
524
|
+
var _useState20 = useState('TRANSCRIPTION_STOPPED'),
|
|
525
|
+
transcriptionState = _useState20[0],
|
|
526
|
+
setTranscriptionState = _useState20[1];
|
|
527
527
|
var meetingRef = useRef();
|
|
528
528
|
var localMicOnRef = useRef();
|
|
529
529
|
var localWebcamOnRef = useRef();
|
|
@@ -623,7 +623,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
623
623
|
setMessages(function (s) {
|
|
624
624
|
return [].concat(s, [data]);
|
|
625
625
|
});
|
|
626
|
-
eventEmitter.emit(events['
|
|
626
|
+
eventEmitter.emit(events['data'], data);
|
|
627
627
|
};
|
|
628
628
|
var _handle_entry_requested = function _handle_entry_requested(data) {
|
|
629
629
|
eventEmitter.emit(events['entry-requested'], data);
|
|
@@ -712,7 +712,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
712
712
|
meeting.off('speaker-changed', _handle_speaker_changed);
|
|
713
713
|
meeting.off('entry-requested', _handle_entry_requested);
|
|
714
714
|
meeting.off('entry-responded', _handle_entry_responded);
|
|
715
|
-
meeting.off('
|
|
715
|
+
meeting.off('data', _handle_chat_message);
|
|
716
716
|
meeting.off('recording-started', _handle_recording_started);
|
|
717
717
|
meeting.off('recording-stopped', _handle_recording_stopped);
|
|
718
718
|
meeting.off('meeting-joined', _handle_meeting_joined);
|
|
@@ -739,8 +739,14 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
739
739
|
meeting.off('whiteboard-stopped', _handle_whiteboard_stopped);
|
|
740
740
|
meeting.off('whiteboard-started', _handle_whiteboard_started);
|
|
741
741
|
meeting.off('transcription-state-changed', _handle_transcription_state_changed);
|
|
742
|
+
meeting.off('transcription-text', _handle_transcription_text);
|
|
742
743
|
meeting.off('character-joined', _handle_character_joined);
|
|
743
744
|
meeting.off('character-left', _handle_character_left);
|
|
745
|
+
meeting.off('media-relay-started', _handle_media_relay_started);
|
|
746
|
+
meeting.off('media-relay-stopped', _handle_media_relay_stopped);
|
|
747
|
+
meeting.off('media-relay-error', _handle_media_relay_error);
|
|
748
|
+
meeting.off('media-relay-request-response', _handle_media_relay_request_response);
|
|
749
|
+
meeting.off('media-relay-request-received', _handle_media_relay_request_received);
|
|
744
750
|
}
|
|
745
751
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') {
|
|
746
752
|
meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled);
|
|
@@ -909,7 +915,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
909
915
|
meeting.on('speaker-changed', _handle_speaker_changed);
|
|
910
916
|
meeting.on('entry-requested', _handle_entry_requested);
|
|
911
917
|
meeting.on('entry-responded', _handle_entry_responded);
|
|
912
|
-
meeting.on('
|
|
918
|
+
meeting.on('data', _handle_chat_message);
|
|
913
919
|
meeting.on('recording-started', _handle_recording_started);
|
|
914
920
|
meeting.on('recording-stopped', _handle_recording_stopped);
|
|
915
921
|
meeting.on('meeting-joined', _handle_meeting_joined);
|
|
@@ -1082,10 +1088,21 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1082
1088
|
meeting.changeMode(mode);
|
|
1083
1089
|
}
|
|
1084
1090
|
};
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1091
|
+
var send = function send(payload, options) {
|
|
1092
|
+
if (options === void 0) {
|
|
1093
|
+
options = {
|
|
1094
|
+
reliability: 'RELIABLE'
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
try {
|
|
1098
|
+
var _meeting = meetingRef.current;
|
|
1099
|
+
return Promise.resolve(function () {
|
|
1100
|
+
if (_meeting) {
|
|
1101
|
+
return Promise.resolve(_meeting.send(payload, options));
|
|
1102
|
+
}
|
|
1103
|
+
}());
|
|
1104
|
+
} catch (e) {
|
|
1105
|
+
return Promise.reject(e);
|
|
1089
1106
|
}
|
|
1090
1107
|
};
|
|
1091
1108
|
var respondEntry = function respondEntry(participantId, decision) {
|
|
@@ -1096,10 +1113,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1096
1113
|
};
|
|
1097
1114
|
var getMics = function getMics() {
|
|
1098
1115
|
try {
|
|
1099
|
-
var
|
|
1116
|
+
var _meeting2 = meetingRef.current;
|
|
1100
1117
|
return Promise.resolve(function () {
|
|
1101
|
-
if (
|
|
1102
|
-
return Promise.resolve(
|
|
1118
|
+
if (_meeting2) {
|
|
1119
|
+
return Promise.resolve(_meeting2.getMics());
|
|
1103
1120
|
}
|
|
1104
1121
|
}());
|
|
1105
1122
|
} catch (e) {
|
|
@@ -1108,10 +1125,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1108
1125
|
};
|
|
1109
1126
|
var getWebcams = function getWebcams() {
|
|
1110
1127
|
try {
|
|
1111
|
-
var
|
|
1128
|
+
var _meeting3 = meetingRef.current;
|
|
1112
1129
|
return Promise.resolve(function () {
|
|
1113
|
-
if (
|
|
1114
|
-
return Promise.resolve(
|
|
1130
|
+
if (_meeting3) {
|
|
1131
|
+
return Promise.resolve(_meeting3.getWebcams());
|
|
1115
1132
|
}
|
|
1116
1133
|
}());
|
|
1117
1134
|
} catch (e) {
|
|
@@ -1218,14 +1235,14 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1218
1235
|
meeting.stopLivestream();
|
|
1219
1236
|
}
|
|
1220
1237
|
};
|
|
1221
|
-
var connectTo = function connectTo(
|
|
1222
|
-
var meetingId =
|
|
1223
|
-
payload =
|
|
1238
|
+
var connectTo = function connectTo(_ref0) {
|
|
1239
|
+
var meetingId = _ref0.meetingId,
|
|
1240
|
+
payload = _ref0.payload;
|
|
1224
1241
|
try {
|
|
1225
|
-
var
|
|
1242
|
+
var _meeting4 = meetingRef.current;
|
|
1226
1243
|
var _temp = function () {
|
|
1227
|
-
if (
|
|
1228
|
-
return Promise.resolve(
|
|
1244
|
+
if (_meeting4) {
|
|
1245
|
+
return Promise.resolve(_meeting4.connectTo({
|
|
1229
1246
|
meetingId: meetingId,
|
|
1230
1247
|
payload: payload
|
|
1231
1248
|
})).then(function () {});
|
|
@@ -1308,7 +1325,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1308
1325
|
resumeAllStreams: resumeAllStreams,
|
|
1309
1326
|
startRecording: startRecording,
|
|
1310
1327
|
stopRecording: stopRecording,
|
|
1311
|
-
|
|
1328
|
+
send: send,
|
|
1312
1329
|
respondEntry: respondEntry,
|
|
1313
1330
|
muteMic: muteMic,
|
|
1314
1331
|
unmuteMic: unmuteMic,
|
|
@@ -1462,6 +1479,12 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1462
1479
|
setTrack(stream);
|
|
1463
1480
|
onStreamEnabled(stream);
|
|
1464
1481
|
};
|
|
1482
|
+
var _handleStreamPaused = function _handleStreamPaused(data) {
|
|
1483
|
+
onStreamPaused(data);
|
|
1484
|
+
};
|
|
1485
|
+
var _handleStreamResumed = function _handleStreamResumed(data) {
|
|
1486
|
+
onStreamResumed(data);
|
|
1487
|
+
};
|
|
1465
1488
|
var _handleParticipantModeChanged = function _handleParticipantModeChanged(data) {
|
|
1466
1489
|
if (participantId === data.participantId) {
|
|
1467
1490
|
setMode(data.mode);
|
|
@@ -1496,6 +1519,18 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1496
1519
|
newStatus: newStatus
|
|
1497
1520
|
});
|
|
1498
1521
|
};
|
|
1522
|
+
var _handleProducerAdded = function _handleProducerAdded(data) {
|
|
1523
|
+
onProducerAdded(data);
|
|
1524
|
+
};
|
|
1525
|
+
var _handleProducerRemoved = function _handleProducerRemoved(data) {
|
|
1526
|
+
onProducerRemoved(data);
|
|
1527
|
+
};
|
|
1528
|
+
var _handleConsumerAdded = function _handleConsumerAdded(data) {
|
|
1529
|
+
onConsumerAdded(data);
|
|
1530
|
+
};
|
|
1531
|
+
var _handleConsumerRemoved = function _handleConsumerRemoved(data) {
|
|
1532
|
+
onConsumerRemoved(data);
|
|
1533
|
+
};
|
|
1499
1534
|
var setQuality = function setQuality(quality) {
|
|
1500
1535
|
participant === null || participant === void 0 ? void 0 : participant.setQuality(quality);
|
|
1501
1536
|
};
|
|
@@ -1574,32 +1609,26 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1574
1609
|
}
|
|
1575
1610
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled);
|
|
1576
1611
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled);
|
|
1577
|
-
participant === null || participant === void 0 ? void 0 : participant.on('stream-paused',
|
|
1578
|
-
|
|
1579
|
-
});
|
|
1580
|
-
participant === null || participant === void 0 ? void 0 : participant.on('stream-resumed', function (data) {
|
|
1581
|
-
onStreamResumed(data);
|
|
1582
|
-
});
|
|
1612
|
+
participant === null || participant === void 0 ? void 0 : participant.on('stream-paused', _handleStreamPaused);
|
|
1613
|
+
participant === null || participant === void 0 ? void 0 : participant.on('stream-resumed', _handleStreamResumed);
|
|
1583
1614
|
participant === null || participant === void 0 ? void 0 : participant.on('media-status-changed', _handleMediaStatusChanged);
|
|
1584
1615
|
participant === null || participant === void 0 ? void 0 : participant.on('video-quality-changed', _handleVideoQualityChanged);
|
|
1585
|
-
participant === null || participant === void 0 ? void 0 : participant.on('producer-added',
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
participant === null || participant === void 0 ? void 0 : participant.on('
|
|
1589
|
-
onProducerRemoved(data);
|
|
1590
|
-
});
|
|
1591
|
-
participant === null || participant === void 0 ? void 0 : participant.on('consumer-added', function (data) {
|
|
1592
|
-
onConsumerAdded(data);
|
|
1593
|
-
});
|
|
1594
|
-
participant === null || participant === void 0 ? void 0 : participant.on('consumer-removed', function (data) {
|
|
1595
|
-
onConsumerRemoved(data);
|
|
1596
|
-
});
|
|
1616
|
+
participant === null || participant === void 0 ? void 0 : participant.on('producer-added', _handleProducerAdded);
|
|
1617
|
+
participant === null || participant === void 0 ? void 0 : participant.on('producer-removed', _handleProducerRemoved);
|
|
1618
|
+
participant === null || participant === void 0 ? void 0 : participant.on('consumer-added', _handleConsumerAdded);
|
|
1619
|
+
participant === null || participant === void 0 ? void 0 : participant.on('consumer-removed', _handleConsumerRemoved);
|
|
1597
1620
|
eventEmitter.on(events['participant-mode-changed'], _handleParticipantModeChanged);
|
|
1598
1621
|
return function () {
|
|
1599
1622
|
participant === null || participant === void 0 ? void 0 : participant.off('stream-enabled', _handleStreamEnabled);
|
|
1600
1623
|
participant === null || participant === void 0 ? void 0 : participant.off('stream-disabled', _handleStreamDisabled);
|
|
1624
|
+
participant === null || participant === void 0 ? void 0 : participant.off('stream-paused', _handleStreamPaused);
|
|
1625
|
+
participant === null || participant === void 0 ? void 0 : participant.off('stream-resumed', _handleStreamResumed);
|
|
1601
1626
|
participant === null || participant === void 0 ? void 0 : participant.off('media-status-changed', _handleMediaStatusChanged);
|
|
1602
1627
|
participant === null || participant === void 0 ? void 0 : participant.off('video-quality-changed', _handleVideoQualityChanged);
|
|
1628
|
+
participant === null || participant === void 0 ? void 0 : participant.off('producer-added', _handleProducerAdded);
|
|
1629
|
+
participant === null || participant === void 0 ? void 0 : participant.off('producer-removed', _handleProducerRemoved);
|
|
1630
|
+
participant === null || participant === void 0 ? void 0 : participant.off('consumer-added', _handleConsumerAdded);
|
|
1631
|
+
participant === null || participant === void 0 ? void 0 : participant.off('consumer-removed', _handleConsumerRemoved);
|
|
1603
1632
|
eventEmitter.off(events['participant-mode-changed'], _handleParticipantModeChanged);
|
|
1604
1633
|
};
|
|
1605
1634
|
}, [participant]);
|
|
@@ -1646,13 +1675,13 @@ var useConnection = function useConnection(connectionId, _temp) {
|
|
|
1646
1675
|
onMeeting: {
|
|
1647
1676
|
onParticipantJoined: function onParticipantJoined() {},
|
|
1648
1677
|
onParticipantLeft: function onParticipantLeft() {},
|
|
1649
|
-
|
|
1678
|
+
onData: function onData() {}
|
|
1650
1679
|
}
|
|
1651
1680
|
} : _temp,
|
|
1652
1681
|
onMeeting = _ref.onMeeting;
|
|
1653
1682
|
var onParticipantJoined = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantJoined;
|
|
1654
1683
|
var onParticipantLeft = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantLeft;
|
|
1655
|
-
var
|
|
1684
|
+
var onData = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onData;
|
|
1656
1685
|
var meeting = useMeeting();
|
|
1657
1686
|
var _useMemo = useMemo(function () {
|
|
1658
1687
|
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId);
|
|
@@ -1687,16 +1716,16 @@ var useConnection = function useConnection(connectionId, _temp) {
|
|
|
1687
1716
|
onParticipantLeft(participantId);
|
|
1688
1717
|
};
|
|
1689
1718
|
var _handleChatMessage = function _handleChatMessage(data) {
|
|
1690
|
-
|
|
1719
|
+
onData(data);
|
|
1691
1720
|
};
|
|
1692
1721
|
useEffect(function () {
|
|
1693
1722
|
connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-joined', _handleParticipantJoined);
|
|
1694
1723
|
connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-left', _handleParticipantLeft);
|
|
1695
|
-
connection === null || connection === void 0 ? void 0 : connection.meeting.on('
|
|
1724
|
+
connection === null || connection === void 0 ? void 0 : connection.meeting.on('data', _handleChatMessage);
|
|
1696
1725
|
return function () {
|
|
1697
1726
|
connection === null || connection === void 0 ? void 0 : connection.meeting.off('participant-joined', _handleParticipantJoined);
|
|
1698
1727
|
connection === null || connection === void 0 ? void 0 : connection.meeting.off('participant-left', _handleParticipantLeft);
|
|
1699
|
-
connection === null || connection === void 0 ? void 0 : connection.meeting.off('
|
|
1728
|
+
connection === null || connection === void 0 ? void 0 : connection.meeting.off('data', _handleChatMessage);
|
|
1700
1729
|
};
|
|
1701
1730
|
}, [connection]);
|
|
1702
1731
|
return {
|
|
@@ -1729,7 +1758,7 @@ var usePubSub = function usePubSub(topic, _temp) {
|
|
|
1729
1758
|
var isSubscribed = useRef(false);
|
|
1730
1759
|
var publish = function publish(message, options, payload) {
|
|
1731
1760
|
if (meeting) {
|
|
1732
|
-
meeting.pubSub.publish(topic, message, options, payload);
|
|
1761
|
+
return meeting.pubSub.publish(topic, message, options, payload);
|
|
1733
1762
|
}
|
|
1734
1763
|
};
|
|
1735
1764
|
var _handlePubSub = function _handlePubSub(data) {
|