@videosdk.live/react-sdk 0.6.4 → 0.6.6
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 +29 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +29 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/participant.d.ts +10 -0
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -456,7 +456,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
456
456
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
|
|
457
457
|
};
|
|
458
458
|
|
|
459
|
-
var version = "0.6.
|
|
459
|
+
var version = "0.6.6";
|
|
460
460
|
|
|
461
461
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
462
462
|
var children = _ref.children,
|
|
@@ -721,6 +721,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
721
721
|
var _meeting$localPartici;
|
|
722
722
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : meeting.off) === 'function') {
|
|
723
723
|
meeting.off('meeting-state-changed', _handle_meeting_state_changed);
|
|
724
|
+
meeting.off('socket-state-changed', _handle_socket_state_changed);
|
|
724
725
|
meeting.off('participant-joined', _handle_participant_joined);
|
|
725
726
|
meeting.off('participant-left', _handle_participant_left);
|
|
726
727
|
meeting.off('presenter-changed', _handle_presenter_changed);
|
|
@@ -859,6 +860,11 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
859
860
|
setIsMeetingJoined(false);
|
|
860
861
|
}
|
|
861
862
|
};
|
|
863
|
+
var _handle_socket_state_changed = function _handle_socket_state_changed(data) {
|
|
864
|
+
if ((data === null || data === void 0 ? void 0 : data.state) == 'SOCKET_DISCONNECTED') {
|
|
865
|
+
setIsMeetingJoined(false);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
862
868
|
var _handle_transcription_state_changed = function _handle_transcription_state_changed(data) {
|
|
863
869
|
setTranscriptionState(data === null || data === void 0 ? void 0 : data.status);
|
|
864
870
|
eventEmitter.emit(events['transcription-state-changed'], data);
|
|
@@ -944,6 +950,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
944
950
|
setCharacters(characters);
|
|
945
951
|
setLocalParticipant(localParticipant);
|
|
946
952
|
meeting.on('meeting-state-changed', _handle_meeting_state_changed);
|
|
953
|
+
meeting.on('socket-state-changed', _handle_socket_state_changed);
|
|
947
954
|
meeting.on('participant-joined', _handle_participant_joined);
|
|
948
955
|
meeting.on('participant-left', _handle_participant_left);
|
|
949
956
|
meeting.on('presenter-changed', _handle_presenter_changed);
|
|
@@ -1467,9 +1474,15 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1467
1474
|
var _useState6 = useState(participant === null || participant === void 0 ? void 0 : participant.micOn),
|
|
1468
1475
|
micOn = _useState6[0],
|
|
1469
1476
|
setMicOn = _useState6[1];
|
|
1470
|
-
var _useState7 = useState(participant === null || participant === void 0 ? void 0 : participant.
|
|
1471
|
-
|
|
1472
|
-
|
|
1477
|
+
var _useState7 = useState(participant === null || participant === void 0 ? void 0 : participant.screenShareOn),
|
|
1478
|
+
screenShareOn = _useState7[0],
|
|
1479
|
+
setScreenShareOn = _useState7[1];
|
|
1480
|
+
var _useState8 = useState(participant === null || participant === void 0 ? void 0 : participant.screenShareAudioOn),
|
|
1481
|
+
screenShareAudioOn = _useState8[0],
|
|
1482
|
+
setScreenShareAudioOn = _useState8[1];
|
|
1483
|
+
var _useState9 = useState(participant === null || participant === void 0 ? void 0 : participant.mode),
|
|
1484
|
+
mode = _useState9[0],
|
|
1485
|
+
setMode = _useState9[1];
|
|
1473
1486
|
var setTrack = function setTrack(stream) {
|
|
1474
1487
|
if (stream.track.readyState === 'live') {
|
|
1475
1488
|
switch (stream.kind) {
|
|
@@ -1553,6 +1566,10 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1553
1566
|
setMicOn(newStatus);
|
|
1554
1567
|
} else if (kind == 'video') {
|
|
1555
1568
|
setWebcamOn(newStatus);
|
|
1569
|
+
} else if (kind == 'share') {
|
|
1570
|
+
setScreenShareOn(newStatus);
|
|
1571
|
+
} else if (kind == 'shareAudio') {
|
|
1572
|
+
setScreenShareAudioOn(newStatus);
|
|
1556
1573
|
}
|
|
1557
1574
|
onMediaStatusChanged({
|
|
1558
1575
|
kind: kind,
|
|
@@ -1648,6 +1665,12 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1648
1665
|
if (participant !== null && participant !== void 0 && participant.webcamOn) {
|
|
1649
1666
|
setWebcamOn(webcamOn);
|
|
1650
1667
|
}
|
|
1668
|
+
if (participant !== null && participant !== void 0 && participant.screenShareOn) {
|
|
1669
|
+
setScreenShareOn(screenShareOn);
|
|
1670
|
+
}
|
|
1671
|
+
if (participant !== null && participant !== void 0 && participant.screenShareAudioOn) {
|
|
1672
|
+
setScreenShareAudioOn(screenShareAudioOn);
|
|
1673
|
+
}
|
|
1651
1674
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled);
|
|
1652
1675
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled);
|
|
1653
1676
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-paused', _handleStreamPaused);
|
|
@@ -1684,7 +1707,8 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1684
1707
|
micOn: micOn || !!micStream,
|
|
1685
1708
|
mode: mode,
|
|
1686
1709
|
metaData: participant === null || participant === void 0 ? void 0 : participant.metaData,
|
|
1687
|
-
screenShareOn: !!screenShareStream,
|
|
1710
|
+
screenShareOn: screenShareOn || !!screenShareStream,
|
|
1711
|
+
screenShareAudioOn: screenShareAudioOn || !!screenShareAudioStream,
|
|
1688
1712
|
isLocal: (localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.id) === participantId,
|
|
1689
1713
|
isActiveSpeaker: activeSpeakerId === participantId,
|
|
1690
1714
|
isMainParticipant: (mainParticipant === null || mainParticipant === void 0 ? void 0 : mainParticipant.id) === participantId,
|