@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.js
CHANGED
|
@@ -458,7 +458,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
458
458
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MeetingProviderContex.Consumer, null, children));
|
|
459
459
|
};
|
|
460
460
|
|
|
461
|
-
var version = "0.6.
|
|
461
|
+
var version = "0.6.6";
|
|
462
462
|
|
|
463
463
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
464
464
|
var children = _ref.children,
|
|
@@ -723,6 +723,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
723
723
|
var _meeting$localPartici;
|
|
724
724
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : meeting.off) === 'function') {
|
|
725
725
|
meeting.off('meeting-state-changed', _handle_meeting_state_changed);
|
|
726
|
+
meeting.off('socket-state-changed', _handle_socket_state_changed);
|
|
726
727
|
meeting.off('participant-joined', _handle_participant_joined);
|
|
727
728
|
meeting.off('participant-left', _handle_participant_left);
|
|
728
729
|
meeting.off('presenter-changed', _handle_presenter_changed);
|
|
@@ -861,6 +862,11 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
861
862
|
setIsMeetingJoined(false);
|
|
862
863
|
}
|
|
863
864
|
};
|
|
865
|
+
var _handle_socket_state_changed = function _handle_socket_state_changed(data) {
|
|
866
|
+
if ((data === null || data === void 0 ? void 0 : data.state) == 'SOCKET_DISCONNECTED') {
|
|
867
|
+
setIsMeetingJoined(false);
|
|
868
|
+
}
|
|
869
|
+
};
|
|
864
870
|
var _handle_transcription_state_changed = function _handle_transcription_state_changed(data) {
|
|
865
871
|
setTranscriptionState(data === null || data === void 0 ? void 0 : data.status);
|
|
866
872
|
eventEmitter.emit(events['transcription-state-changed'], data);
|
|
@@ -946,6 +952,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
946
952
|
setCharacters(characters);
|
|
947
953
|
setLocalParticipant(localParticipant);
|
|
948
954
|
meeting.on('meeting-state-changed', _handle_meeting_state_changed);
|
|
955
|
+
meeting.on('socket-state-changed', _handle_socket_state_changed);
|
|
949
956
|
meeting.on('participant-joined', _handle_participant_joined);
|
|
950
957
|
meeting.on('participant-left', _handle_participant_left);
|
|
951
958
|
meeting.on('presenter-changed', _handle_presenter_changed);
|
|
@@ -1469,9 +1476,15 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1469
1476
|
var _useState6 = React.useState(participant === null || participant === void 0 ? void 0 : participant.micOn),
|
|
1470
1477
|
micOn = _useState6[0],
|
|
1471
1478
|
setMicOn = _useState6[1];
|
|
1472
|
-
var _useState7 = React.useState(participant === null || participant === void 0 ? void 0 : participant.
|
|
1473
|
-
|
|
1474
|
-
|
|
1479
|
+
var _useState7 = React.useState(participant === null || participant === void 0 ? void 0 : participant.screenShareOn),
|
|
1480
|
+
screenShareOn = _useState7[0],
|
|
1481
|
+
setScreenShareOn = _useState7[1];
|
|
1482
|
+
var _useState8 = React.useState(participant === null || participant === void 0 ? void 0 : participant.screenShareAudioOn),
|
|
1483
|
+
screenShareAudioOn = _useState8[0],
|
|
1484
|
+
setScreenShareAudioOn = _useState8[1];
|
|
1485
|
+
var _useState9 = React.useState(participant === null || participant === void 0 ? void 0 : participant.mode),
|
|
1486
|
+
mode = _useState9[0],
|
|
1487
|
+
setMode = _useState9[1];
|
|
1475
1488
|
var setTrack = function setTrack(stream) {
|
|
1476
1489
|
if (stream.track.readyState === 'live') {
|
|
1477
1490
|
switch (stream.kind) {
|
|
@@ -1555,6 +1568,10 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1555
1568
|
setMicOn(newStatus);
|
|
1556
1569
|
} else if (kind == 'video') {
|
|
1557
1570
|
setWebcamOn(newStatus);
|
|
1571
|
+
} else if (kind == 'share') {
|
|
1572
|
+
setScreenShareOn(newStatus);
|
|
1573
|
+
} else if (kind == 'shareAudio') {
|
|
1574
|
+
setScreenShareAudioOn(newStatus);
|
|
1558
1575
|
}
|
|
1559
1576
|
onMediaStatusChanged({
|
|
1560
1577
|
kind: kind,
|
|
@@ -1650,6 +1667,12 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1650
1667
|
if (participant !== null && participant !== void 0 && participant.webcamOn) {
|
|
1651
1668
|
setWebcamOn(webcamOn);
|
|
1652
1669
|
}
|
|
1670
|
+
if (participant !== null && participant !== void 0 && participant.screenShareOn) {
|
|
1671
|
+
setScreenShareOn(screenShareOn);
|
|
1672
|
+
}
|
|
1673
|
+
if (participant !== null && participant !== void 0 && participant.screenShareAudioOn) {
|
|
1674
|
+
setScreenShareAudioOn(screenShareAudioOn);
|
|
1675
|
+
}
|
|
1653
1676
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled);
|
|
1654
1677
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled);
|
|
1655
1678
|
participant === null || participant === void 0 ? void 0 : participant.on('stream-paused', _handleStreamPaused);
|
|
@@ -1686,7 +1709,8 @@ var useParticipant = function useParticipant(participantId, _temp) {
|
|
|
1686
1709
|
micOn: micOn || !!micStream,
|
|
1687
1710
|
mode: mode,
|
|
1688
1711
|
metaData: participant === null || participant === void 0 ? void 0 : participant.metaData,
|
|
1689
|
-
screenShareOn: !!screenShareStream,
|
|
1712
|
+
screenShareOn: screenShareOn || !!screenShareStream,
|
|
1713
|
+
screenShareAudioOn: screenShareAudioOn || !!screenShareAudioStream,
|
|
1690
1714
|
isLocal: (localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.id) === participantId,
|
|
1691
1715
|
isActiveSpeaker: activeSpeakerId === participantId,
|
|
1692
1716
|
isMainParticipant: (mainParticipant === null || mainParticipant === void 0 ? void 0 : mainParticipant.id) === participantId,
|