@videosdk.live/react-sdk
Advanced tools
Comparing version 0.1.53 to 0.1.54
@@ -44,63 +44,63 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var MeetingProviderContex = React.createContext(); | ||
var useMeeting = function useMeeting(_temp) { | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onParticipantJoi = _ref.onParticipantJoined, | ||
onParticipantJoined = _ref$onParticipantJoi === void 0 ? function () {} : _ref$onParticipantJoi, | ||
_ref$onParticipantLef = _ref.onParticipantLeft, | ||
onParticipantLeft = _ref$onParticipantLef === void 0 ? function () {} : _ref$onParticipantLef, | ||
_ref$onSpeakerChanged = _ref.onSpeakerChanged, | ||
onSpeakerChanged = _ref$onSpeakerChanged === void 0 ? function () {} : _ref$onSpeakerChanged, | ||
_ref$onPresenterChang = _ref.onPresenterChanged, | ||
onPresenterChanged = _ref$onPresenterChang === void 0 ? function () {} : _ref$onPresenterChang, | ||
_ref$onMainParticipan = _ref.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref$onMainParticipan === void 0 ? function () {} : _ref$onMainParticipan, | ||
_ref$onEntryRequested = _ref.onEntryRequested, | ||
onEntryRequested = _ref$onEntryRequested === void 0 ? function () {} : _ref$onEntryRequested, | ||
_ref$onEntryResponded = _ref.onEntryResponded, | ||
onEntryResponded = _ref$onEntryResponded === void 0 ? function () {} : _ref$onEntryResponded, | ||
_ref$onRecordingStart = _ref.onRecordingStarted, | ||
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart, | ||
_ref$onRecordingStopp = _ref.onRecordingStopped, | ||
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp, | ||
_ref$onChatMessage = _ref.onChatMessage, | ||
onChatMessage = _ref$onChatMessage === void 0 ? function () {} : _ref$onChatMessage, | ||
_ref$onMeetingJoined = _ref.onMeetingJoined, | ||
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined, | ||
_ref$onMeetingLeft = _ref.onMeetingLeft, | ||
onMeetingLeft = _ref$onMeetingLeft === void 0 ? function () {} : _ref$onMeetingLeft, | ||
_ref$onLiveStreamStar = _ref.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref$onLiveStreamStar === void 0 ? function () {} : _ref$onLiveStreamStar, | ||
_ref$onLiveStreamStop = _ref.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop, | ||
_ref$onVideoStateChan = _ref.onVideoStateChanged, | ||
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan, | ||
_ref$onVideoSeeked = _ref.onVideoSeeked, | ||
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked, | ||
_ref$onWebcamRequeste = _ref.onWebcamRequested, | ||
onWebcamRequested = _ref$onWebcamRequeste === void 0 ? function () {} : _ref$onWebcamRequeste, | ||
_ref$onMicRequested = _ref.onMicRequested, | ||
onMicRequested = _ref$onMicRequested === void 0 ? function () {} : _ref$onMicRequested, | ||
_ref$onPinStateChange = _ref.onPinStateChanged, | ||
onPinStateChanged = _ref$onPinStateChange === void 0 ? function () {} : _ref$onPinStateChange, | ||
_ref$onConnectionOpen = _ref.onConnectionOpen, | ||
onConnectionOpen = _ref$onConnectionOpen === void 0 ? function () {} : _ref$onConnectionOpen, | ||
_ref$onConnetionClose = _ref.onConnetionClose, | ||
onConnetionClose = _ref$onConnetionClose === void 0 ? function () {} : _ref$onConnetionClose, | ||
_ref$onSwitchMeeting = _ref.onSwitchMeeting, | ||
onSwitchMeeting = _ref$onSwitchMeeting === void 0 ? function () {} : _ref$onSwitchMeeting, | ||
_ref$onError = _ref.onError, | ||
onError = _ref$onError === void 0 ? function () {} : _ref$onError, | ||
_ref$onHlsStarted = _ref.onHlsStarted, | ||
onHlsStarted = _ref$onHlsStarted === void 0 ? function () {} : _ref$onHlsStarted, | ||
_ref$onHlsStopped = _ref.onHlsStopped, | ||
onHlsStopped = _ref$onHlsStopped === void 0 ? function () {} : _ref$onHlsStopped, | ||
_ref$onHlsStateChange = _ref.onHlsStateChanged, | ||
onHlsStateChanged = _ref$onHlsStateChange === void 0 ? function () {} : _ref$onHlsStateChange, | ||
_ref$onRecordingState = _ref.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref$onRecordingState === void 0 ? function () {} : _ref$onRecordingState, | ||
_ref$onLivestreamStat = _ref.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref$onLivestreamStat === void 0 ? function () {} : _ref$onLivestreamStat, | ||
_ref$onMeetingStateCh = _ref.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref$onMeetingStateCh === void 0 ? function () {} : _ref$onMeetingStateCh; | ||
_ref$onParticipantJoi = _ref.onParticipantJoined, | ||
onParticipantJoined = _ref$onParticipantJoi === void 0 ? function () {} : _ref$onParticipantJoi, | ||
_ref$onParticipantLef = _ref.onParticipantLeft, | ||
onParticipantLeft = _ref$onParticipantLef === void 0 ? function () {} : _ref$onParticipantLef, | ||
_ref$onSpeakerChanged = _ref.onSpeakerChanged, | ||
onSpeakerChanged = _ref$onSpeakerChanged === void 0 ? function () {} : _ref$onSpeakerChanged, | ||
_ref$onPresenterChang = _ref.onPresenterChanged, | ||
onPresenterChanged = _ref$onPresenterChang === void 0 ? function () {} : _ref$onPresenterChang, | ||
_ref$onMainParticipan = _ref.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref$onMainParticipan === void 0 ? function () {} : _ref$onMainParticipan, | ||
_ref$onEntryRequested = _ref.onEntryRequested, | ||
onEntryRequested = _ref$onEntryRequested === void 0 ? function () {} : _ref$onEntryRequested, | ||
_ref$onEntryResponded = _ref.onEntryResponded, | ||
onEntryResponded = _ref$onEntryResponded === void 0 ? function () {} : _ref$onEntryResponded, | ||
_ref$onRecordingStart = _ref.onRecordingStarted, | ||
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart, | ||
_ref$onRecordingStopp = _ref.onRecordingStopped, | ||
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp, | ||
_ref$onChatMessage = _ref.onChatMessage, | ||
onChatMessage = _ref$onChatMessage === void 0 ? function () {} : _ref$onChatMessage, | ||
_ref$onMeetingJoined = _ref.onMeetingJoined, | ||
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined, | ||
_ref$onMeetingLeft = _ref.onMeetingLeft, | ||
onMeetingLeft = _ref$onMeetingLeft === void 0 ? function () {} : _ref$onMeetingLeft, | ||
_ref$onLiveStreamStar = _ref.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref$onLiveStreamStar === void 0 ? function () {} : _ref$onLiveStreamStar, | ||
_ref$onLiveStreamStop = _ref.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop, | ||
_ref$onVideoStateChan = _ref.onVideoStateChanged, | ||
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan, | ||
_ref$onVideoSeeked = _ref.onVideoSeeked, | ||
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked, | ||
_ref$onWebcamRequeste = _ref.onWebcamRequested, | ||
onWebcamRequested = _ref$onWebcamRequeste === void 0 ? function () {} : _ref$onWebcamRequeste, | ||
_ref$onMicRequested = _ref.onMicRequested, | ||
onMicRequested = _ref$onMicRequested === void 0 ? function () {} : _ref$onMicRequested, | ||
_ref$onPinStateChange = _ref.onPinStateChanged, | ||
onPinStateChanged = _ref$onPinStateChange === void 0 ? function () {} : _ref$onPinStateChange, | ||
_ref$onConnectionOpen = _ref.onConnectionOpen, | ||
onConnectionOpen = _ref$onConnectionOpen === void 0 ? function () {} : _ref$onConnectionOpen, | ||
_ref$onConnetionClose = _ref.onConnetionClose, | ||
onConnetionClose = _ref$onConnetionClose === void 0 ? function () {} : _ref$onConnetionClose, | ||
_ref$onSwitchMeeting = _ref.onSwitchMeeting, | ||
onSwitchMeeting = _ref$onSwitchMeeting === void 0 ? function () {} : _ref$onSwitchMeeting, | ||
_ref$onError = _ref.onError, | ||
onError = _ref$onError === void 0 ? function () {} : _ref$onError, | ||
_ref$onHlsStarted = _ref.onHlsStarted, | ||
onHlsStarted = _ref$onHlsStarted === void 0 ? function () {} : _ref$onHlsStarted, | ||
_ref$onHlsStopped = _ref.onHlsStopped, | ||
onHlsStopped = _ref$onHlsStopped === void 0 ? function () {} : _ref$onHlsStopped, | ||
_ref$onHlsStateChange = _ref.onHlsStateChanged, | ||
onHlsStateChanged = _ref$onHlsStateChange === void 0 ? function () {} : _ref$onHlsStateChange, | ||
_ref$onRecordingState = _ref.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref$onRecordingState === void 0 ? function () {} : _ref$onRecordingState, | ||
_ref$onLivestreamStat = _ref.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref$onLivestreamStat === void 0 ? function () {} : _ref$onLivestreamStat, | ||
_ref$onMeetingStateCh = _ref.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref$onMeetingStateCh === void 0 ? function () {} : _ref$onMeetingStateCh; | ||
React.useEffect(function () { | ||
@@ -172,60 +172,60 @@ eventEmitter.on(events['participant-joined'], onParticipantJoined); | ||
var children = _ref2.children, | ||
_ref2$onParticipantJo = _ref2.onParticipantJoined, | ||
onParticipantJoined = _ref2$onParticipantJo === void 0 ? function () {} : _ref2$onParticipantJo, | ||
_ref2$onParticipantLe = _ref2.onParticipantLeft, | ||
onParticipantLeft = _ref2$onParticipantLe === void 0 ? function () {} : _ref2$onParticipantLe, | ||
_ref2$onSpeakerChange = _ref2.onSpeakerChanged, | ||
onSpeakerChanged = _ref2$onSpeakerChange === void 0 ? function () {} : _ref2$onSpeakerChange, | ||
_ref2$onPresenterChan = _ref2.onPresenterChanged, | ||
onPresenterChanged = _ref2$onPresenterChan === void 0 ? function () {} : _ref2$onPresenterChan, | ||
_ref2$onMainParticipa = _ref2.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref2$onMainParticipa === void 0 ? function () {} : _ref2$onMainParticipa, | ||
_ref2$onEntryRequeste = _ref2.onEntryRequested, | ||
onEntryRequested = _ref2$onEntryRequeste === void 0 ? function () {} : _ref2$onEntryRequeste, | ||
_ref2$onEntryResponde = _ref2.onEntryResponded, | ||
onEntryResponded = _ref2$onEntryResponde === void 0 ? function () {} : _ref2$onEntryResponde, | ||
_ref2$onRecordingStar = _ref2.onRecordingStarted, | ||
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar, | ||
_ref2$onRecordingStop = _ref2.onRecordingStopped, | ||
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop, | ||
_ref2$onChatMessage = _ref2.onChatMessage, | ||
onChatMessage = _ref2$onChatMessage === void 0 ? function () {} : _ref2$onChatMessage, | ||
_ref2$onMeetingJoined = _ref2.onMeetingJoined, | ||
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined, | ||
_ref2$onMeetingLeft = _ref2.onMeetingLeft, | ||
onMeetingLeft = _ref2$onMeetingLeft === void 0 ? function () {} : _ref2$onMeetingLeft, | ||
_ref2$onLiveStreamSta = _ref2.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref2$onLiveStreamSta === void 0 ? function () {} : _ref2$onLiveStreamSta, | ||
_ref2$onLiveStreamSto = _ref2.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto, | ||
_ref2$onVideoStateCha = _ref2.onVideoStateChanged, | ||
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha, | ||
_ref2$onVideoSeeked = _ref2.onVideoSeeked, | ||
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked, | ||
_ref2$onWebcamRequest = _ref2.onWebcamRequested, | ||
onWebcamRequested = _ref2$onWebcamRequest === void 0 ? function () {} : _ref2$onWebcamRequest, | ||
_ref2$onMicRequested = _ref2.onMicRequested, | ||
onMicRequested = _ref2$onMicRequested === void 0 ? function () {} : _ref2$onMicRequested, | ||
_ref2$onPinStateChang = _ref2.onPinStateChanged, | ||
onPinStateChanged = _ref2$onPinStateChang === void 0 ? function () {} : _ref2$onPinStateChang, | ||
_ref2$onConnectionOpe = _ref2.onConnectionOpen, | ||
onConnectionOpen = _ref2$onConnectionOpe === void 0 ? function () {} : _ref2$onConnectionOpe, | ||
_ref2$onConnetionClos = _ref2.onConnetionClose, | ||
onConnetionClose = _ref2$onConnetionClos === void 0 ? function () {} : _ref2$onConnetionClos, | ||
_ref2$onSwitchMeeting = _ref2.onSwitchMeeting, | ||
onSwitchMeeting = _ref2$onSwitchMeeting === void 0 ? function () {} : _ref2$onSwitchMeeting, | ||
_ref2$onError = _ref2.onError, | ||
onError = _ref2$onError === void 0 ? function () {} : _ref2$onError, | ||
_ref2$onHlsStarted = _ref2.onHlsStarted, | ||
onHlsStarted = _ref2$onHlsStarted === void 0 ? function () {} : _ref2$onHlsStarted, | ||
_ref2$onHlsStopped = _ref2.onHlsStopped, | ||
onHlsStopped = _ref2$onHlsStopped === void 0 ? function () {} : _ref2$onHlsStopped, | ||
_ref2$onHlsStateChang = _ref2.onHlsStateChanged, | ||
onHlsStateChanged = _ref2$onHlsStateChang === void 0 ? function () {} : _ref2$onHlsStateChang, | ||
_ref2$onRecordingStat = _ref2.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref2$onRecordingStat === void 0 ? function () {} : _ref2$onRecordingStat, | ||
_ref2$onLivestreamSta = _ref2.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref2$onLivestreamSta === void 0 ? function () {} : _ref2$onLivestreamSta, | ||
_ref2$onMeetingStateC = _ref2.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref2$onMeetingStateC === void 0 ? function () {} : _ref2$onMeetingStateC; | ||
_ref2$onParticipantJo = _ref2.onParticipantJoined, | ||
onParticipantJoined = _ref2$onParticipantJo === void 0 ? function () {} : _ref2$onParticipantJo, | ||
_ref2$onParticipantLe = _ref2.onParticipantLeft, | ||
onParticipantLeft = _ref2$onParticipantLe === void 0 ? function () {} : _ref2$onParticipantLe, | ||
_ref2$onSpeakerChange = _ref2.onSpeakerChanged, | ||
onSpeakerChanged = _ref2$onSpeakerChange === void 0 ? function () {} : _ref2$onSpeakerChange, | ||
_ref2$onPresenterChan = _ref2.onPresenterChanged, | ||
onPresenterChanged = _ref2$onPresenterChan === void 0 ? function () {} : _ref2$onPresenterChan, | ||
_ref2$onMainParticipa = _ref2.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref2$onMainParticipa === void 0 ? function () {} : _ref2$onMainParticipa, | ||
_ref2$onEntryRequeste = _ref2.onEntryRequested, | ||
onEntryRequested = _ref2$onEntryRequeste === void 0 ? function () {} : _ref2$onEntryRequeste, | ||
_ref2$onEntryResponde = _ref2.onEntryResponded, | ||
onEntryResponded = _ref2$onEntryResponde === void 0 ? function () {} : _ref2$onEntryResponde, | ||
_ref2$onRecordingStar = _ref2.onRecordingStarted, | ||
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar, | ||
_ref2$onRecordingStop = _ref2.onRecordingStopped, | ||
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop, | ||
_ref2$onChatMessage = _ref2.onChatMessage, | ||
onChatMessage = _ref2$onChatMessage === void 0 ? function () {} : _ref2$onChatMessage, | ||
_ref2$onMeetingJoined = _ref2.onMeetingJoined, | ||
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined, | ||
_ref2$onMeetingLeft = _ref2.onMeetingLeft, | ||
onMeetingLeft = _ref2$onMeetingLeft === void 0 ? function () {} : _ref2$onMeetingLeft, | ||
_ref2$onLiveStreamSta = _ref2.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref2$onLiveStreamSta === void 0 ? function () {} : _ref2$onLiveStreamSta, | ||
_ref2$onLiveStreamSto = _ref2.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto, | ||
_ref2$onVideoStateCha = _ref2.onVideoStateChanged, | ||
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha, | ||
_ref2$onVideoSeeked = _ref2.onVideoSeeked, | ||
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked, | ||
_ref2$onWebcamRequest = _ref2.onWebcamRequested, | ||
onWebcamRequested = _ref2$onWebcamRequest === void 0 ? function () {} : _ref2$onWebcamRequest, | ||
_ref2$onMicRequested = _ref2.onMicRequested, | ||
onMicRequested = _ref2$onMicRequested === void 0 ? function () {} : _ref2$onMicRequested, | ||
_ref2$onPinStateChang = _ref2.onPinStateChanged, | ||
onPinStateChanged = _ref2$onPinStateChang === void 0 ? function () {} : _ref2$onPinStateChang, | ||
_ref2$onConnectionOpe = _ref2.onConnectionOpen, | ||
onConnectionOpen = _ref2$onConnectionOpe === void 0 ? function () {} : _ref2$onConnectionOpe, | ||
_ref2$onConnetionClos = _ref2.onConnetionClose, | ||
onConnetionClose = _ref2$onConnetionClos === void 0 ? function () {} : _ref2$onConnetionClos, | ||
_ref2$onSwitchMeeting = _ref2.onSwitchMeeting, | ||
onSwitchMeeting = _ref2$onSwitchMeeting === void 0 ? function () {} : _ref2$onSwitchMeeting, | ||
_ref2$onError = _ref2.onError, | ||
onError = _ref2$onError === void 0 ? function () {} : _ref2$onError, | ||
_ref2$onHlsStarted = _ref2.onHlsStarted, | ||
onHlsStarted = _ref2$onHlsStarted === void 0 ? function () {} : _ref2$onHlsStarted, | ||
_ref2$onHlsStopped = _ref2.onHlsStopped, | ||
onHlsStopped = _ref2$onHlsStopped === void 0 ? function () {} : _ref2$onHlsStopped, | ||
_ref2$onHlsStateChang = _ref2.onHlsStateChanged, | ||
onHlsStateChanged = _ref2$onHlsStateChang === void 0 ? function () {} : _ref2$onHlsStateChang, | ||
_ref2$onRecordingStat = _ref2.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref2$onRecordingStat === void 0 ? function () {} : _ref2$onRecordingStat, | ||
_ref2$onLivestreamSta = _ref2.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref2$onLivestreamSta === void 0 ? function () {} : _ref2$onLivestreamSta, | ||
_ref2$onMeetingStateC = _ref2.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref2$onMeetingStateC === void 0 ? function () {} : _ref2$onMeetingStateC; | ||
React.useEffect(function () { | ||
@@ -300,84 +300,64 @@ eventEmitter.on(events['meeting-state-changed'], onMeetingStateChanged); | ||
var children = _ref.children, | ||
config = _ref.config, | ||
token = _ref.token, | ||
joinWithoutUserInteraction = _ref.joinWithoutUserInteraction, | ||
_reinitialiseMeetingOnConfigChange = _ref.reinitialiseMeetingOnConfigChange, | ||
deviceInfo = _ref.deviceInfo; | ||
config = _ref.config, | ||
token = _ref.token, | ||
joinWithoutUserInteraction = _ref.joinWithoutUserInteraction, | ||
_reinitialiseMeetingOnConfigChange = _ref.reinitialiseMeetingOnConfigChange, | ||
deviceInfo = _ref.deviceInfo; | ||
var _useState = React.useState(null), | ||
meeting = _useState[0], | ||
setMeeting = _useState[1]; | ||
meeting = _useState[0], | ||
setMeeting = _useState[1]; | ||
var _useState2 = React.useState(null), | ||
localParticipant = _useState2[0], | ||
setLocalParticipant = _useState2[1]; | ||
localParticipant = _useState2[0], | ||
setLocalParticipant = _useState2[1]; | ||
var _useState3 = React.useState(null), | ||
mainParticipant = _useState3[0], | ||
setMainParticipant = _useState3[1]; | ||
mainParticipant = _useState3[0], | ||
setMainParticipant = _useState3[1]; | ||
var _useState4 = React.useState(null), | ||
activeSpeakerId = _useState4[0], | ||
setActiveSpeakerId = _useState4[1]; | ||
activeSpeakerId = _useState4[0], | ||
setActiveSpeakerId = _useState4[1]; | ||
var _useState5 = React.useState(null), | ||
presenterId = _useState5[0], | ||
setPresenterId = _useState5[1]; | ||
presenterId = _useState5[0], | ||
setPresenterId = _useState5[1]; | ||
var _useState6 = React.useState(false), | ||
localMicOn = _useState6[0], | ||
setLocalMicOn = _useState6[1]; | ||
localMicOn = _useState6[0], | ||
setLocalMicOn = _useState6[1]; | ||
var _useState7 = React.useState(false), | ||
localWebcamOn = _useState7[0], | ||
setLocalWebcamOn = _useState7[1]; | ||
localWebcamOn = _useState7[0], | ||
setLocalWebcamOn = _useState7[1]; | ||
var _useState8 = React.useState(false), | ||
localScreenShareOn = _useState8[0], | ||
setLocalScreenShareOn = _useState8[1]; | ||
localScreenShareOn = _useState8[0], | ||
setLocalScreenShareOn = _useState8[1]; | ||
var _useState9 = React.useState(false), | ||
isRecording = _useState9[0], | ||
setIsRecording = _useState9[1]; | ||
isRecording = _useState9[0], | ||
setIsRecording = _useState9[1]; | ||
var _useState10 = React.useState([]), | ||
messages = _useState10[0], | ||
setMessages = _useState10[1]; | ||
messages = _useState10[0], | ||
setMessages = _useState10[1]; | ||
var _useState11 = React.useState(new Map()), | ||
participants = _useState11[0], | ||
setParticipants = _useState11[1]; | ||
participants = _useState11[0], | ||
setParticipants = _useState11[1]; | ||
var _useState12 = React.useState(new Map()), | ||
pinnedParticipants = _useState12[0], | ||
setPinnedParticipants = _useState12[1]; | ||
pinnedParticipants = _useState12[0], | ||
setPinnedParticipants = _useState12[1]; | ||
var _useState13 = React.useState(false), | ||
isLiveStreaming = _useState13[0], | ||
setIsLiveStreaming = _useState13[1]; | ||
isLiveStreaming = _useState13[0], | ||
setIsLiveStreaming = _useState13[1]; | ||
var _useState14 = React.useState(new Map()), | ||
connections = _useState14[0], | ||
setConnections = _useState14[1]; | ||
connections = _useState14[0], | ||
setConnections = _useState14[1]; | ||
var _useState15 = React.useState(false), | ||
isMeetingJoined = _useState15[0], | ||
setIsMeetingJoined = _useState15[1]; | ||
isMeetingJoined = _useState15[0], | ||
setIsMeetingJoined = _useState15[1]; | ||
var _useState16 = React.useState(false), | ||
isHls = _useState16[0], | ||
setIsHls = _useState16[1]; | ||
isHls = _useState16[0], | ||
setIsHls = _useState16[1]; | ||
var _useState17 = React.useState(null), | ||
recordingState = _useState17[0], | ||
setRecordingState = _useState17[1]; | ||
recordingState = _useState17[0], | ||
setRecordingState = _useState17[1]; | ||
var _useState18 = React.useState(null), | ||
livestreamState = _useState18[0], | ||
setLivestreamState = _useState18[1]; | ||
livestreamState = _useState18[0], | ||
setLivestreamState = _useState18[1]; | ||
var _useState19 = React.useState(null), | ||
hlsState = _useState19[0], | ||
setHlsState = _useState19[1]; | ||
hlsState = _useState19[0], | ||
setHlsState = _useState19[1]; | ||
var meetingRef = React.useRef(); | ||
@@ -419,3 +399,2 @@ var localMicOnRef = React.useRef(); | ||
}, [isHls]); | ||
var resetStates = function resetStates() { | ||
@@ -442,3 +421,2 @@ setMeeting(null); | ||
}; | ||
var _handle_participant_joined = function _handle_participant_joined(participant) { | ||
@@ -452,3 +430,2 @@ setParticipants(function (participants) { | ||
}; | ||
var _handle_participant_left = function _handle_participant_left(participant) { | ||
@@ -462,6 +439,4 @@ setParticipants(function (participants) { | ||
}; | ||
var _handle_presenter_changed = function _handle_presenter_changed(presenterId) { | ||
var _meetingRef$current, _meetingRef$current$l; | ||
setPresenterId(presenterId); | ||
@@ -471,3 +446,2 @@ 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)); | ||
}; | ||
var _handle_main_participant_changed = function _handle_main_participant_changed(participant) { | ||
@@ -477,3 +451,2 @@ setMainParticipant(participant); | ||
}; | ||
var _handle_speaker_changed = function _handle_speaker_changed(activeSpeakerId) { | ||
@@ -483,3 +456,2 @@ setActiveSpeakerId(activeSpeakerId); | ||
}; | ||
var _handle_chat_message = function _handle_chat_message(data) { | ||
@@ -491,11 +463,8 @@ setMessages(function (s) { | ||
}; | ||
var _handle_entry_requested = function _handle_entry_requested(data) { | ||
eventEmitter.emit(events['entry-requested'], data); | ||
}; | ||
var _handle_entry_responded = function _handle_entry_responded(participantId, decision) { | ||
eventEmitter.emit(events['entry-responded'], participantId, decision); | ||
}; | ||
var _handle_recording_started = function _handle_recording_started() { | ||
@@ -505,3 +474,2 @@ setIsRecording(true); | ||
}; | ||
var _handle_recording_stopped = function _handle_recording_stopped() { | ||
@@ -511,3 +479,2 @@ setIsRecording(false); | ||
}; | ||
var _handle_localParticipant_stream_enabled = function _handle_localParticipant_stream_enabled(stream) { | ||
@@ -522,3 +489,2 @@ if (stream.track.readyState === 'live') { | ||
}; | ||
var _handle_localParticipant_stream_disabled = function _handle_localParticipant_stream_disabled(stream) { | ||
@@ -533,3 +499,2 @@ if (stream.track.readyState === 'ended') { | ||
}; | ||
var _handle_live_stream_started = function _handle_live_stream_started(data) { | ||
@@ -539,3 +504,2 @@ setIsLiveStreaming(true); | ||
}; | ||
var _handle_live_stream_stopped = function _handle_live_stream_stopped() { | ||
@@ -545,3 +509,2 @@ setIsLiveStreaming(false); | ||
}; | ||
var _handle_hls_started = function _handle_hls_started(data) { | ||
@@ -551,3 +514,2 @@ setIsHls(true); | ||
}; | ||
var _handle_hls_stopped = function _handle_hls_stopped() { | ||
@@ -557,19 +519,14 @@ setIsHls(false); | ||
}; | ||
var _handle_video_state_changed = function _handle_video_state_changed(data) { | ||
eventEmitter.emit(events['video-state-changed'], data); | ||
}; | ||
var _handle_video_seeked = function _handle_video_seeked(data) { | ||
eventEmitter.emit(events['video-seeked'], data); | ||
}; | ||
var _handle_webcam_requested = function _handle_webcam_requested(data) { | ||
eventEmitter.emit(events['webcam-requested'], data); | ||
}; | ||
var _handle_mic_requested = function _handle_mic_requested(data) { | ||
eventEmitter.emit(events['mic-requested'], data); | ||
}; | ||
var _handle_meeting_joined = function _handle_meeting_joined(data) { | ||
@@ -583,10 +540,7 @@ joinedOnFirstRender.current = true; | ||
}; | ||
var _handle_meeting_left = function _handle_meeting_left() { | ||
eventEmitter.emit(events['meeting-left']); | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
var _meeting$localPartici; | ||
if (typeof (meeting === null || meeting === void 0 ? void 0 : meeting.off) === 'function') { | ||
@@ -623,3 +577,2 @@ meeting.off('meeting-state-changed', _handle_meeting_state_changed); | ||
} | ||
if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') { | ||
@@ -629,11 +582,9 @@ meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled); | ||
} | ||
resetStates(); | ||
} | ||
}; | ||
var _handle_pin_state_changed = function _handle_pin_state_changed(_ref2) { | ||
var participantId = _ref2.participantId, | ||
state = _ref2.state, | ||
pinnedBy = _ref2.pinnedBy; | ||
state = _ref2.state, | ||
pinnedBy = _ref2.pinnedBy; | ||
setPinnedParticipants(function (pinnedParticipants) { | ||
@@ -645,3 +596,2 @@ if (!state.cam && !state.share) { | ||
} | ||
var pinnedParticipantsToSet = new Map(pinnedParticipants); | ||
@@ -656,3 +606,2 @@ return pinnedParticipantsToSet; | ||
}; | ||
var _handle_connection_open = function _handle_connection_open(connection) { | ||
@@ -666,3 +615,2 @@ setConnections(function (s) { | ||
}; | ||
var _handle_connection_close = function _handle_connection_close(connectionId) { | ||
@@ -676,11 +624,8 @@ setConnections(function (s) { | ||
}; | ||
var _handle_switch_meeting = function _handle_switch_meeting(d) { | ||
eventEmitter.emit(events['switch-meeting'], d); | ||
}; | ||
var _handle_error = function _handle_error(data) { | ||
eventEmitter.emit(events['error'], data); | ||
}; | ||
var _handle_recording_state_changed = function _handle_recording_state_changed(data) { | ||
@@ -690,3 +635,2 @@ setRecordingState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_livestream_state_changed = function _handle_livestream_state_changed(data) { | ||
@@ -696,3 +640,2 @@ setLivestreamState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_hls_state_changed = function _handle_hls_state_changed(data) { | ||
@@ -702,7 +645,5 @@ setHlsState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) { | ||
eventEmitter.emit(events['meeting-state-changed'], data); | ||
}; | ||
var join = function join() { | ||
@@ -712,3 +653,3 @@ var meeting = jsSdk.VideoSDK && jsSdk.VideoSDK.initMeeting(configRef.current); | ||
var localParticipant = meeting.localParticipant, | ||
participants = meeting.participants; | ||
participants = meeting.participants; | ||
participants.set(localParticipant.id, localParticipant); | ||
@@ -750,6 +691,4 @@ setParticipants(participants); | ||
}; | ||
var leave = function leave() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -759,6 +698,4 @@ meeting.leave(); | ||
}; | ||
var end = function end() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -768,6 +705,4 @@ meeting.end(); | ||
}; | ||
var startRecording = function startRecording(webhookUrl, awsDirPath, config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -777,9 +712,6 @@ meeting.startRecording(webhookUrl, awsDirPath, config); | ||
}; | ||
var stopRecording = function stopRecording() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
var _isRecording = isRecordingRef.current; | ||
if (_isRecording) { | ||
@@ -790,3 +722,2 @@ meeting.stopRecording(); | ||
}; | ||
var unmuteMic = function unmuteMic(customAudioTrack) { | ||
@@ -796,5 +727,3 @@ if (customAudioTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -804,6 +733,4 @@ meeting.unmuteMic(customAudioTrack); | ||
}; | ||
var muteMic = function muteMic() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -813,3 +740,2 @@ meeting.muteMic(); | ||
}; | ||
var toggleMic = function toggleMic(customAudioTrack) { | ||
@@ -819,5 +745,3 @@ if (customAudioTrack === void 0) { | ||
} | ||
var localMicOn = localMicOnRef.current; | ||
if (localMicOn) { | ||
@@ -829,6 +753,4 @@ muteMic(); | ||
}; | ||
var disableWebcam = function disableWebcam() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -838,3 +760,2 @@ meeting.disableWebcam(); | ||
}; | ||
var enableWebcam = function enableWebcam(customVideoTrack) { | ||
@@ -844,5 +765,3 @@ if (customVideoTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -852,3 +771,2 @@ meeting.enableWebcam(customVideoTrack); | ||
}; | ||
var toggleWebcam = function toggleWebcam(customVideoTrack) { | ||
@@ -858,5 +776,3 @@ if (customVideoTrack === void 0) { | ||
} | ||
var localWebcamOn = localWebcamOnRef.current; | ||
if (localWebcamOn) { | ||
@@ -868,6 +784,4 @@ disableWebcam(); | ||
}; | ||
var disableScreenShare = function disableScreenShare() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -877,3 +791,2 @@ meeting.disableScreenShare(); | ||
}; | ||
var enableScreenShare = function enableScreenShare(customScreenShareTrack) { | ||
@@ -883,5 +796,3 @@ if (customScreenShareTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -891,3 +802,2 @@ meeting.enableScreenShare(customScreenShareTrack); | ||
}; | ||
var toggleScreenShare = function toggleScreenShare(customScreenShareTrack) { | ||
@@ -897,5 +807,3 @@ if (customScreenShareTrack === void 0) { | ||
} | ||
var localScreenShareOn = localScreenShareOnRef.current; | ||
if (localScreenShareOn) { | ||
@@ -907,6 +815,4 @@ disableScreenShare(); | ||
}; | ||
var sendChatMessage = function sendChatMessage(text) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -916,6 +822,4 @@ meeting.sendChatMessage(text); | ||
}; | ||
var respondEntry = function respondEntry(participantId, decision) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -925,3 +829,2 @@ meeting.respondEntry(participantId, decision); | ||
}; | ||
var getMics = function getMics() { | ||
@@ -939,3 +842,2 @@ try { | ||
}; | ||
var getWebcams = function getWebcams() { | ||
@@ -953,6 +855,4 @@ try { | ||
}; | ||
var changeWebcam = function changeWebcam(obj) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -962,6 +862,4 @@ meeting.changeWebcam(obj); | ||
}; | ||
var changeMic = function changeMic(obj) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -971,7 +869,5 @@ meeting.changeMic(obj); | ||
}; | ||
var startVideo = function startVideo(_ref3) { | ||
var link = _ref3.link; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -983,6 +879,4 @@ meeting.startVideo({ | ||
}; | ||
var stopVideo = function stopVideo() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -992,6 +886,4 @@ meeting.stopVideo(); | ||
}; | ||
var resumeVideo = function resumeVideo() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1001,7 +893,5 @@ meeting.resumeVideo(); | ||
}; | ||
var pauseVideo = function pauseVideo(_ref4) { | ||
var currentTime = _ref4.currentTime; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1013,7 +903,5 @@ meeting.pauseVideo({ | ||
}; | ||
var seekVideo = function seekVideo(_ref5) { | ||
var currentTime = _ref5.currentTime; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1025,6 +913,4 @@ meeting.seekVideo({ | ||
}; | ||
var startLivestream = function startLivestream(streamInfo, config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1034,6 +920,4 @@ meeting.startLivestream(streamInfo, config); | ||
}; | ||
var stopLivestream = function stopLivestream() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1043,10 +927,7 @@ meeting.stopLivestream(); | ||
}; | ||
var connectTo = function connectTo(_ref6) { | ||
var meetingId = _ref6.meetingId, | ||
payload = _ref6.payload; | ||
payload = _ref6.payload; | ||
try { | ||
var _meeting3 = meetingRef.current; | ||
var _temp2 = function () { | ||
@@ -1060,3 +941,2 @@ if (_meeting3) { | ||
}(); | ||
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0); | ||
@@ -1067,6 +947,4 @@ } catch (e) { | ||
}; | ||
var startHls = function startHls(config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1076,6 +954,4 @@ meeting.startHls(config); | ||
}; | ||
var stopHls = function stopHls() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1085,6 +961,4 @@ meeting.stopHls(); | ||
}; | ||
var initSDK = function initSDK() { | ||
jsSdk.VideoSDK.config(tokenRef.current); | ||
if (deviceInfo) { | ||
@@ -1098,3 +972,2 @@ jsSdk.VideoSDK.analytics(deviceInfo); | ||
} | ||
if (joinWithoutUserInteraction) { | ||
@@ -1104,3 +977,2 @@ join(); | ||
}; | ||
React.useEffect(function () { | ||
@@ -1175,64 +1047,55 @@ initSDK(); | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onStreamEnabled = _ref.onStreamEnabled, | ||
onStreamEnabled = _ref$onStreamEnabled === void 0 ? function () {} : _ref$onStreamEnabled, | ||
_ref$onStreamDisabled = _ref.onStreamDisabled, | ||
onStreamDisabled = _ref$onStreamDisabled === void 0 ? function () {} : _ref$onStreamDisabled, | ||
_ref$onMediaStatusCha = _ref.onMediaStatusChanged, | ||
onMediaStatusChanged = _ref$onMediaStatusCha === void 0 ? function () {} : _ref$onMediaStatusCha, | ||
_ref$onVideoQualityCh = _ref.onVideoQualityChanged, | ||
onVideoQualityChanged = _ref$onVideoQualityCh === void 0 ? function () {} : _ref$onVideoQualityCh; | ||
_ref$onStreamEnabled = _ref.onStreamEnabled, | ||
onStreamEnabled = _ref$onStreamEnabled === void 0 ? function () {} : _ref$onStreamEnabled, | ||
_ref$onStreamDisabled = _ref.onStreamDisabled, | ||
onStreamDisabled = _ref$onStreamDisabled === void 0 ? function () {} : _ref$onStreamDisabled, | ||
_ref$onMediaStatusCha = _ref.onMediaStatusChanged, | ||
onMediaStatusChanged = _ref$onMediaStatusCha === void 0 ? function () {} : _ref$onMediaStatusCha, | ||
_ref$onVideoQualityCh = _ref.onVideoQualityChanged, | ||
onVideoQualityChanged = _ref$onVideoQualityCh === void 0 ? function () {} : _ref$onVideoQualityCh; | ||
var _useState = React.useState(null), | ||
webcamStream = _useState[0], | ||
setwebcamStream = _useState[1]; | ||
webcamStream = _useState[0], | ||
setwebcamStream = _useState[1]; | ||
var _useState2 = React.useState(null), | ||
micStream = _useState2[0], | ||
setMicStream = _useState2[1]; | ||
micStream = _useState2[0], | ||
setMicStream = _useState2[1]; | ||
var _useState3 = React.useState(null), | ||
screenShareStream = _useState3[0], | ||
setScreenShareStream = _useState3[1]; | ||
screenShareStream = _useState3[0], | ||
setScreenShareStream = _useState3[1]; | ||
var _useState4 = React.useState(null), | ||
screenShareAudioStream = _useState4[0], | ||
setScreenShareAudioStream = _useState4[1]; | ||
screenShareAudioStream = _useState4[0], | ||
setScreenShareAudioStream = _useState4[1]; | ||
var meeting = useMeeting(); | ||
var _useMemo = React.useMemo(function () { | ||
var _meeting$pinnedPartic; | ||
var _meeting$pinnedPartic; | ||
var participants = meeting === null || meeting === void 0 ? void 0 : meeting.participants; | ||
var localParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.localParticipant; | ||
var activeSpeakerId = meeting === null || meeting === void 0 ? void 0 : meeting.activeSpeakerId; | ||
var mainParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.mainParticipant; | ||
var pinState = (meeting === null || meeting === void 0 ? void 0 : (_meeting$pinnedPartic = meeting.pinnedParticipants) === null || _meeting$pinnedPartic === void 0 ? void 0 : _meeting$pinnedPartic.get(participantId)) || { | ||
cam: false, | ||
share: false | ||
}; | ||
var participants = meeting === null || meeting === void 0 ? void 0 : meeting.participants; | ||
var localParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.localParticipant; | ||
var activeSpeakerId = meeting === null || meeting === void 0 ? void 0 : meeting.activeSpeakerId; | ||
var mainParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.mainParticipant; | ||
var pinState = (meeting === null || meeting === void 0 ? void 0 : (_meeting$pinnedPartic = meeting.pinnedParticipants) === null || _meeting$pinnedPartic === void 0 ? void 0 : _meeting$pinnedPartic.get(participantId)) || { | ||
cam: false, | ||
share: false | ||
}; | ||
return { | ||
participants: participants, | ||
localParticipant: localParticipant, | ||
activeSpeakerId: activeSpeakerId, | ||
mainParticipant: mainParticipant, | ||
pinState: pinState | ||
}; | ||
}, [meeting]), | ||
participants = _useMemo.participants, | ||
localParticipant = _useMemo.localParticipant, | ||
activeSpeakerId = _useMemo.activeSpeakerId, | ||
mainParticipant = _useMemo.mainParticipant, | ||
pinState = _useMemo.pinState; | ||
return { | ||
participants: participants, | ||
localParticipant: localParticipant, | ||
activeSpeakerId: activeSpeakerId, | ||
mainParticipant: mainParticipant, | ||
pinState: pinState | ||
}; | ||
}, [meeting]), | ||
participants = _useMemo.participants, | ||
localParticipant = _useMemo.localParticipant, | ||
activeSpeakerId = _useMemo.activeSpeakerId, | ||
mainParticipant = _useMemo.mainParticipant, | ||
pinState = _useMemo.pinState; | ||
var participant = participants === null || participants === void 0 ? void 0 : participants.get(participantId); | ||
var _useState5 = React.useState(participant === null || participant === void 0 ? void 0 : participant.webcamOn), | ||
webcamOn = _useState5[0], | ||
setWebcamOn = _useState5[1]; | ||
webcamOn = _useState5[0], | ||
setWebcamOn = _useState5[1]; | ||
var _useState6 = React.useState(participant === null || participant === void 0 ? void 0 : participant.micOn), | ||
micOn = _useState6[0], | ||
setMicOn = _useState6[1]; | ||
micOn = _useState6[0], | ||
setMicOn = _useState6[1]; | ||
var setTrack = function setTrack(stream) { | ||
@@ -1244,11 +1107,8 @@ if (stream.track.readyState === 'live') { | ||
break; | ||
case 'audio': | ||
setMicStream(stream); | ||
break; | ||
case 'share': | ||
setScreenShareStream(stream); | ||
break; | ||
case 'shareAudio': | ||
@@ -1260,3 +1120,2 @@ setScreenShareAudioStream(stream); | ||
}; | ||
var unSetTrack = function unSetTrack(stream) { | ||
@@ -1268,11 +1127,8 @@ if (stream.track.readyState !== 'live') { | ||
break; | ||
case 'audio': | ||
setMicStream(null); | ||
break; | ||
case 'share': | ||
setScreenShareStream(null); | ||
break; | ||
case 'shareAudio': | ||
@@ -1284,3 +1140,2 @@ setScreenShareAudioStream(null); | ||
}; | ||
var _handleStreamEnabled = function _handleStreamEnabled(stream) { | ||
@@ -1290,3 +1145,2 @@ setTrack(stream); | ||
}; | ||
var _handleStreamDisabled = function _handleStreamDisabled(stream) { | ||
@@ -1296,7 +1150,6 @@ unSetTrack(stream); | ||
}; | ||
var _handleVideoQualityChanged = function _handleVideoQualityChanged(data) { | ||
var peerId = data.peerId, | ||
prevQuality = data.prevQuality, | ||
currentQuality = data.currentQuality; | ||
prevQuality = data.prevQuality, | ||
currentQuality = data.currentQuality; | ||
onVideoQualityChanged({ | ||
@@ -1308,8 +1161,6 @@ peerId: peerId, | ||
}; | ||
var _handleMediaStatusChanged = function _handleMediaStatusChanged(data) { | ||
var kind = data.kind, | ||
peerId = data.peerId, | ||
newStatus = data.newStatus; | ||
peerId = data.peerId, | ||
newStatus = data.newStatus; | ||
if (kind == 'audio') { | ||
@@ -1320,3 +1171,2 @@ setMicOn(newStatus); | ||
} | ||
onMediaStatusChanged({ | ||
@@ -1328,66 +1178,52 @@ kind: kind, | ||
}; | ||
var setQuality = function setQuality(quality) { | ||
participant === null || participant === void 0 ? void 0 : participant.setQuality(quality); | ||
}; | ||
var setViewPort = function setViewPort(width, height) { | ||
participant === null || participant === void 0 ? void 0 : participant.setViewPort(width, height); | ||
}; | ||
var enableMic = function enableMic() { | ||
participant === null || participant === void 0 ? void 0 : participant.enableMic(); | ||
}; | ||
var disableMic = function disableMic() { | ||
participant === null || participant === void 0 ? void 0 : participant.disableMic(); | ||
}; | ||
var enableWebcam = function enableWebcam() { | ||
participant === null || participant === void 0 ? void 0 : participant.enableWebcam(); | ||
}; | ||
var disableWebcam = function disableWebcam() { | ||
participant === null || participant === void 0 ? void 0 : participant.disableWebcam(); | ||
}; | ||
var pin = function pin(data) { | ||
participant === null || participant === void 0 ? void 0 : participant.pin(data); | ||
}; | ||
var unpin = function unpin(data) { | ||
participant === null || participant === void 0 ? void 0 : participant.unpin(data); | ||
}; | ||
var getAudioStats = function getAudioStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats()); | ||
}; | ||
var getVideoStats = function getVideoStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getVideoStats()); | ||
}; | ||
var getShareStats = function getShareStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getShareStats()); | ||
}; | ||
var consumeWebcamStreams = function consumeWebcamStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.consumeWebcamStreams(); | ||
}; | ||
var consumeMicStreams = function consumeMicStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.consumeMicStreams(); | ||
}; | ||
var stopConsumingWebcamStreams = function stopConsumingWebcamStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.stopConsumingWebcamStreams(); | ||
}; | ||
var stopConsumingMicStreams = function stopConsumingMicStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.stopConsumingMicStreams(); | ||
}; | ||
var switchTo = function switchTo(data) { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.switchTo(data)).then(function () {}); | ||
}; | ||
React.useEffect(function () { | ||
var streams = participant === null || participant === void 0 ? void 0 : participant.streams; | ||
if (streams) { | ||
@@ -1398,11 +1234,8 @@ streams.forEach(function (stream) { | ||
} | ||
if (participant !== null && participant !== void 0 && participant.micOn) { | ||
setMicOn(micOn); | ||
} | ||
if (participant !== null && participant !== void 0 && participant.webcamOn) { | ||
setWebcamOn(webcamOn); | ||
} | ||
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled); | ||
@@ -1448,3 +1281,4 @@ participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled); | ||
getAudioStats: getAudioStats, | ||
getVideoStats: getVideoStats | ||
getVideoStats: getVideoStats, | ||
getShareStats: getShareStats | ||
}; | ||
@@ -1455,10 +1289,9 @@ }; | ||
var _ref = _temp === void 0 ? { | ||
onMeeting: { | ||
onParticipantJoined: function onParticipantJoined() {}, | ||
onParticipantLeft: function onParticipantLeft() {}, | ||
onChatMessage: function onChatMessage() {} | ||
} | ||
} : _temp, | ||
onMeeting = _ref.onMeeting; | ||
onMeeting: { | ||
onParticipantJoined: function onParticipantJoined() {}, | ||
onParticipantLeft: function onParticipantLeft() {}, | ||
onChatMessage: function onChatMessage() {} | ||
} | ||
} : _temp, | ||
onMeeting = _ref.onMeeting; | ||
var onParticipantJoined = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantJoined; | ||
@@ -1468,23 +1301,18 @@ var onParticipantLeft = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantLeft; | ||
var meeting = useMeeting(); | ||
var _useMemo = React.useMemo(function () { | ||
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId); | ||
if (!connection) { | ||
throw new Error('connectionId not found'); | ||
} | ||
var connectionParticipants = new Map(connection.meeting.participants); | ||
return { | ||
connection: connection, | ||
connectionParticipants: connectionParticipants | ||
}; | ||
}, [meeting]), | ||
connection = _useMemo.connection, | ||
connectionParticipants = _useMemo.connectionParticipants; | ||
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId); | ||
if (!connection) { | ||
throw new Error('connectionId not found'); | ||
} | ||
var connectionParticipants = new Map(connection.meeting.participants); | ||
return { | ||
connection: connection, | ||
connectionParticipants: connectionParticipants | ||
}; | ||
}, [meeting]), | ||
connection = _useMemo.connection, | ||
connectionParticipants = _useMemo.connectionParticipants; | ||
var _useState = React.useState(new Map(connectionParticipants)), | ||
_connectionParticipants = _useState[0], | ||
setConnectionParticipants = _useState[1]; | ||
_connectionParticipants = _useState[0], | ||
setConnectionParticipants = _useState[1]; | ||
var _handleParticipantJoined = function _handleParticipantJoined(participant) { | ||
@@ -1498,3 +1326,2 @@ setConnectionParticipants(function (s) { | ||
}; | ||
var _handleParticipantLeft = function _handleParticipantLeft(participantId) { | ||
@@ -1508,7 +1335,5 @@ setConnectionParticipants(function (s) { | ||
}; | ||
var _handleChatMessage = function _handleChatMessage(data) { | ||
onChatMessage(data); | ||
}; | ||
React.useEffect(function () { | ||
@@ -1541,15 +1366,12 @@ connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-joined', _handleParticipantJoined); | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onMessageReceive = _ref.onMessageReceived, | ||
onMessageReceived = _ref$onMessageReceive === void 0 ? function () {} : _ref$onMessageReceive, | ||
_ref$onOldMessagesRec = _ref.onOldMessagesReceived, | ||
onOldMessagesReceived = _ref$onOldMessagesRec === void 0 ? function () {} : _ref$onOldMessagesRec; | ||
_ref$onMessageReceive = _ref.onMessageReceived, | ||
onMessageReceived = _ref$onMessageReceive === void 0 ? function () {} : _ref$onMessageReceive, | ||
_ref$onOldMessagesRec = _ref.onOldMessagesReceived, | ||
onOldMessagesReceived = _ref$onOldMessagesRec === void 0 ? function () {} : _ref$onOldMessagesRec; | ||
var _useMeeting = useMeeting(), | ||
meeting = _useMeeting.meeting, | ||
isMeetingJoined = _useMeeting.isMeetingJoined; | ||
meeting = _useMeeting.meeting, | ||
isMeetingJoined = _useMeeting.isMeetingJoined; | ||
var _useState = React.useState([]), | ||
messages = _useState[0], | ||
setMessages = _useState[1]; | ||
messages = _useState[0], | ||
setMessages = _useState[1]; | ||
var isSubscribed = React.useRef(false); | ||
@@ -1562,3 +1384,2 @@ | ||
}; | ||
var _handlePubSub = function _handlePubSub(data) { | ||
@@ -1570,7 +1391,5 @@ setMessages(function (s) { | ||
}; | ||
var subscribeToPubsub = function subscribeToPubsub(meeting) { | ||
try { | ||
var _meeting$pubSub; | ||
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) { | ||
@@ -1586,3 +1405,2 @@ if (data) { | ||
}; | ||
React.useEffect(function () { | ||
@@ -1594,3 +1412,2 @@ if (meeting && !isSubscribed.current && isMeetingJoined) { | ||
var _meeting$pubSub2; | ||
meeting === null || meeting === void 0 ? void 0 : (_meeting$pubSub2 = meeting.pubSub) === null || _meeting$pubSub2 === void 0 ? void 0 : _meeting$pubSub2.unsubscribe(topic, _handlePubSub); | ||
@@ -1610,12 +1427,11 @@ }; | ||
var _ref$cameraId = _ref.cameraId, | ||
cameraId = _ref$cameraId === void 0 ? undefined : _ref$cameraId, | ||
_ref$encoderConfig = _ref.encoderConfig, | ||
encoderConfig = _ref$encoderConfig === void 0 ? undefined : _ref$encoderConfig, | ||
_ref$facingMode = _ref.facingMode, | ||
facingMode = _ref$facingMode === void 0 ? undefined : _ref$facingMode, | ||
_ref$optimizationMode = _ref.optimizationMode, | ||
optimizationMode = _ref$optimizationMode === void 0 ? undefined : _ref$optimizationMode, | ||
_ref$multiStream = _ref.multiStream, | ||
multiStream = _ref$multiStream === void 0 ? true : _ref$multiStream; | ||
cameraId = _ref$cameraId === void 0 ? undefined : _ref$cameraId, | ||
_ref$encoderConfig = _ref.encoderConfig, | ||
encoderConfig = _ref$encoderConfig === void 0 ? undefined : _ref$encoderConfig, | ||
_ref$facingMode = _ref.facingMode, | ||
facingMode = _ref$facingMode === void 0 ? undefined : _ref$facingMode, | ||
_ref$optimizationMode = _ref.optimizationMode, | ||
optimizationMode = _ref$optimizationMode === void 0 ? undefined : _ref$optimizationMode, | ||
_ref$multiStream = _ref.multiStream, | ||
multiStream = _ref$multiStream === void 0 ? true : _ref$multiStream; | ||
try { | ||
@@ -1636,8 +1452,7 @@ return Promise.resolve(jsSdk.VideoSDK.createCameraVideoTrack({ | ||
var _ref2$encoderConfig = _ref2.encoderConfig, | ||
encoderConfig = _ref2$encoderConfig === void 0 ? undefined : _ref2$encoderConfig, | ||
_ref2$optimizationMod = _ref2.optimizationMode, | ||
optimizationMode = _ref2$optimizationMod === void 0 ? undefined : _ref2$optimizationMod, | ||
_ref2$withAudio = _ref2.withAudio, | ||
withAudio = _ref2$withAudio === void 0 ? 'enable' : _ref2$withAudio; | ||
encoderConfig = _ref2$encoderConfig === void 0 ? undefined : _ref2$encoderConfig, | ||
_ref2$optimizationMod = _ref2.optimizationMode, | ||
optimizationMode = _ref2$optimizationMod === void 0 ? undefined : _ref2$optimizationMod, | ||
_ref2$withAudio = _ref2.withAudio, | ||
withAudio = _ref2$withAudio === void 0 ? 'enable' : _ref2$withAudio; | ||
try { | ||
@@ -1656,8 +1471,7 @@ return Promise.resolve(jsSdk.VideoSDK.createScreenShareVideoTrack({ | ||
var _ref3$noiseConfig = _ref3.noiseConfig, | ||
noiseConfig = _ref3$noiseConfig === void 0 ? undefined : _ref3$noiseConfig, | ||
_ref3$encoderConfig = _ref3.encoderConfig, | ||
encoderConfig = _ref3$encoderConfig === void 0 ? undefined : _ref3$encoderConfig, | ||
_ref3$microphoneId = _ref3.microphoneId, | ||
microphoneId = _ref3$microphoneId === void 0 ? undefined : _ref3$microphoneId; | ||
noiseConfig = _ref3$noiseConfig === void 0 ? undefined : _ref3$noiseConfig, | ||
_ref3$encoderConfig = _ref3.encoderConfig, | ||
encoderConfig = _ref3$encoderConfig === void 0 ? undefined : _ref3$encoderConfig, | ||
_ref3$microphoneId = _ref3.microphoneId, | ||
microphoneId = _ref3$microphoneId === void 0 ? undefined : _ref3$microphoneId; | ||
try { | ||
@@ -1664,0 +1478,0 @@ return Promise.resolve(jsSdk.VideoSDK.createMicrophoneAudioTrack({ |
@@ -41,63 +41,63 @@ import React, { createContext, useEffect, useContext, useState, useRef, useMemo } from 'react'; | ||
var MeetingProviderContex = createContext(); | ||
var useMeeting = function useMeeting(_temp) { | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onParticipantJoi = _ref.onParticipantJoined, | ||
onParticipantJoined = _ref$onParticipantJoi === void 0 ? function () {} : _ref$onParticipantJoi, | ||
_ref$onParticipantLef = _ref.onParticipantLeft, | ||
onParticipantLeft = _ref$onParticipantLef === void 0 ? function () {} : _ref$onParticipantLef, | ||
_ref$onSpeakerChanged = _ref.onSpeakerChanged, | ||
onSpeakerChanged = _ref$onSpeakerChanged === void 0 ? function () {} : _ref$onSpeakerChanged, | ||
_ref$onPresenterChang = _ref.onPresenterChanged, | ||
onPresenterChanged = _ref$onPresenterChang === void 0 ? function () {} : _ref$onPresenterChang, | ||
_ref$onMainParticipan = _ref.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref$onMainParticipan === void 0 ? function () {} : _ref$onMainParticipan, | ||
_ref$onEntryRequested = _ref.onEntryRequested, | ||
onEntryRequested = _ref$onEntryRequested === void 0 ? function () {} : _ref$onEntryRequested, | ||
_ref$onEntryResponded = _ref.onEntryResponded, | ||
onEntryResponded = _ref$onEntryResponded === void 0 ? function () {} : _ref$onEntryResponded, | ||
_ref$onRecordingStart = _ref.onRecordingStarted, | ||
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart, | ||
_ref$onRecordingStopp = _ref.onRecordingStopped, | ||
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp, | ||
_ref$onChatMessage = _ref.onChatMessage, | ||
onChatMessage = _ref$onChatMessage === void 0 ? function () {} : _ref$onChatMessage, | ||
_ref$onMeetingJoined = _ref.onMeetingJoined, | ||
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined, | ||
_ref$onMeetingLeft = _ref.onMeetingLeft, | ||
onMeetingLeft = _ref$onMeetingLeft === void 0 ? function () {} : _ref$onMeetingLeft, | ||
_ref$onLiveStreamStar = _ref.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref$onLiveStreamStar === void 0 ? function () {} : _ref$onLiveStreamStar, | ||
_ref$onLiveStreamStop = _ref.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop, | ||
_ref$onVideoStateChan = _ref.onVideoStateChanged, | ||
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan, | ||
_ref$onVideoSeeked = _ref.onVideoSeeked, | ||
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked, | ||
_ref$onWebcamRequeste = _ref.onWebcamRequested, | ||
onWebcamRequested = _ref$onWebcamRequeste === void 0 ? function () {} : _ref$onWebcamRequeste, | ||
_ref$onMicRequested = _ref.onMicRequested, | ||
onMicRequested = _ref$onMicRequested === void 0 ? function () {} : _ref$onMicRequested, | ||
_ref$onPinStateChange = _ref.onPinStateChanged, | ||
onPinStateChanged = _ref$onPinStateChange === void 0 ? function () {} : _ref$onPinStateChange, | ||
_ref$onConnectionOpen = _ref.onConnectionOpen, | ||
onConnectionOpen = _ref$onConnectionOpen === void 0 ? function () {} : _ref$onConnectionOpen, | ||
_ref$onConnetionClose = _ref.onConnetionClose, | ||
onConnetionClose = _ref$onConnetionClose === void 0 ? function () {} : _ref$onConnetionClose, | ||
_ref$onSwitchMeeting = _ref.onSwitchMeeting, | ||
onSwitchMeeting = _ref$onSwitchMeeting === void 0 ? function () {} : _ref$onSwitchMeeting, | ||
_ref$onError = _ref.onError, | ||
onError = _ref$onError === void 0 ? function () {} : _ref$onError, | ||
_ref$onHlsStarted = _ref.onHlsStarted, | ||
onHlsStarted = _ref$onHlsStarted === void 0 ? function () {} : _ref$onHlsStarted, | ||
_ref$onHlsStopped = _ref.onHlsStopped, | ||
onHlsStopped = _ref$onHlsStopped === void 0 ? function () {} : _ref$onHlsStopped, | ||
_ref$onHlsStateChange = _ref.onHlsStateChanged, | ||
onHlsStateChanged = _ref$onHlsStateChange === void 0 ? function () {} : _ref$onHlsStateChange, | ||
_ref$onRecordingState = _ref.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref$onRecordingState === void 0 ? function () {} : _ref$onRecordingState, | ||
_ref$onLivestreamStat = _ref.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref$onLivestreamStat === void 0 ? function () {} : _ref$onLivestreamStat, | ||
_ref$onMeetingStateCh = _ref.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref$onMeetingStateCh === void 0 ? function () {} : _ref$onMeetingStateCh; | ||
_ref$onParticipantJoi = _ref.onParticipantJoined, | ||
onParticipantJoined = _ref$onParticipantJoi === void 0 ? function () {} : _ref$onParticipantJoi, | ||
_ref$onParticipantLef = _ref.onParticipantLeft, | ||
onParticipantLeft = _ref$onParticipantLef === void 0 ? function () {} : _ref$onParticipantLef, | ||
_ref$onSpeakerChanged = _ref.onSpeakerChanged, | ||
onSpeakerChanged = _ref$onSpeakerChanged === void 0 ? function () {} : _ref$onSpeakerChanged, | ||
_ref$onPresenterChang = _ref.onPresenterChanged, | ||
onPresenterChanged = _ref$onPresenterChang === void 0 ? function () {} : _ref$onPresenterChang, | ||
_ref$onMainParticipan = _ref.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref$onMainParticipan === void 0 ? function () {} : _ref$onMainParticipan, | ||
_ref$onEntryRequested = _ref.onEntryRequested, | ||
onEntryRequested = _ref$onEntryRequested === void 0 ? function () {} : _ref$onEntryRequested, | ||
_ref$onEntryResponded = _ref.onEntryResponded, | ||
onEntryResponded = _ref$onEntryResponded === void 0 ? function () {} : _ref$onEntryResponded, | ||
_ref$onRecordingStart = _ref.onRecordingStarted, | ||
onRecordingStarted = _ref$onRecordingStart === void 0 ? function () {} : _ref$onRecordingStart, | ||
_ref$onRecordingStopp = _ref.onRecordingStopped, | ||
onRecordingStopped = _ref$onRecordingStopp === void 0 ? function () {} : _ref$onRecordingStopp, | ||
_ref$onChatMessage = _ref.onChatMessage, | ||
onChatMessage = _ref$onChatMessage === void 0 ? function () {} : _ref$onChatMessage, | ||
_ref$onMeetingJoined = _ref.onMeetingJoined, | ||
onMeetingJoined = _ref$onMeetingJoined === void 0 ? function () {} : _ref$onMeetingJoined, | ||
_ref$onMeetingLeft = _ref.onMeetingLeft, | ||
onMeetingLeft = _ref$onMeetingLeft === void 0 ? function () {} : _ref$onMeetingLeft, | ||
_ref$onLiveStreamStar = _ref.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref$onLiveStreamStar === void 0 ? function () {} : _ref$onLiveStreamStar, | ||
_ref$onLiveStreamStop = _ref.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop, | ||
_ref$onVideoStateChan = _ref.onVideoStateChanged, | ||
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan, | ||
_ref$onVideoSeeked = _ref.onVideoSeeked, | ||
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked, | ||
_ref$onWebcamRequeste = _ref.onWebcamRequested, | ||
onWebcamRequested = _ref$onWebcamRequeste === void 0 ? function () {} : _ref$onWebcamRequeste, | ||
_ref$onMicRequested = _ref.onMicRequested, | ||
onMicRequested = _ref$onMicRequested === void 0 ? function () {} : _ref$onMicRequested, | ||
_ref$onPinStateChange = _ref.onPinStateChanged, | ||
onPinStateChanged = _ref$onPinStateChange === void 0 ? function () {} : _ref$onPinStateChange, | ||
_ref$onConnectionOpen = _ref.onConnectionOpen, | ||
onConnectionOpen = _ref$onConnectionOpen === void 0 ? function () {} : _ref$onConnectionOpen, | ||
_ref$onConnetionClose = _ref.onConnetionClose, | ||
onConnetionClose = _ref$onConnetionClose === void 0 ? function () {} : _ref$onConnetionClose, | ||
_ref$onSwitchMeeting = _ref.onSwitchMeeting, | ||
onSwitchMeeting = _ref$onSwitchMeeting === void 0 ? function () {} : _ref$onSwitchMeeting, | ||
_ref$onError = _ref.onError, | ||
onError = _ref$onError === void 0 ? function () {} : _ref$onError, | ||
_ref$onHlsStarted = _ref.onHlsStarted, | ||
onHlsStarted = _ref$onHlsStarted === void 0 ? function () {} : _ref$onHlsStarted, | ||
_ref$onHlsStopped = _ref.onHlsStopped, | ||
onHlsStopped = _ref$onHlsStopped === void 0 ? function () {} : _ref$onHlsStopped, | ||
_ref$onHlsStateChange = _ref.onHlsStateChanged, | ||
onHlsStateChanged = _ref$onHlsStateChange === void 0 ? function () {} : _ref$onHlsStateChange, | ||
_ref$onRecordingState = _ref.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref$onRecordingState === void 0 ? function () {} : _ref$onRecordingState, | ||
_ref$onLivestreamStat = _ref.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref$onLivestreamStat === void 0 ? function () {} : _ref$onLivestreamStat, | ||
_ref$onMeetingStateCh = _ref.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref$onMeetingStateCh === void 0 ? function () {} : _ref$onMeetingStateCh; | ||
useEffect(function () { | ||
@@ -169,60 +169,60 @@ eventEmitter.on(events['participant-joined'], onParticipantJoined); | ||
var children = _ref2.children, | ||
_ref2$onParticipantJo = _ref2.onParticipantJoined, | ||
onParticipantJoined = _ref2$onParticipantJo === void 0 ? function () {} : _ref2$onParticipantJo, | ||
_ref2$onParticipantLe = _ref2.onParticipantLeft, | ||
onParticipantLeft = _ref2$onParticipantLe === void 0 ? function () {} : _ref2$onParticipantLe, | ||
_ref2$onSpeakerChange = _ref2.onSpeakerChanged, | ||
onSpeakerChanged = _ref2$onSpeakerChange === void 0 ? function () {} : _ref2$onSpeakerChange, | ||
_ref2$onPresenterChan = _ref2.onPresenterChanged, | ||
onPresenterChanged = _ref2$onPresenterChan === void 0 ? function () {} : _ref2$onPresenterChan, | ||
_ref2$onMainParticipa = _ref2.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref2$onMainParticipa === void 0 ? function () {} : _ref2$onMainParticipa, | ||
_ref2$onEntryRequeste = _ref2.onEntryRequested, | ||
onEntryRequested = _ref2$onEntryRequeste === void 0 ? function () {} : _ref2$onEntryRequeste, | ||
_ref2$onEntryResponde = _ref2.onEntryResponded, | ||
onEntryResponded = _ref2$onEntryResponde === void 0 ? function () {} : _ref2$onEntryResponde, | ||
_ref2$onRecordingStar = _ref2.onRecordingStarted, | ||
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar, | ||
_ref2$onRecordingStop = _ref2.onRecordingStopped, | ||
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop, | ||
_ref2$onChatMessage = _ref2.onChatMessage, | ||
onChatMessage = _ref2$onChatMessage === void 0 ? function () {} : _ref2$onChatMessage, | ||
_ref2$onMeetingJoined = _ref2.onMeetingJoined, | ||
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined, | ||
_ref2$onMeetingLeft = _ref2.onMeetingLeft, | ||
onMeetingLeft = _ref2$onMeetingLeft === void 0 ? function () {} : _ref2$onMeetingLeft, | ||
_ref2$onLiveStreamSta = _ref2.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref2$onLiveStreamSta === void 0 ? function () {} : _ref2$onLiveStreamSta, | ||
_ref2$onLiveStreamSto = _ref2.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto, | ||
_ref2$onVideoStateCha = _ref2.onVideoStateChanged, | ||
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha, | ||
_ref2$onVideoSeeked = _ref2.onVideoSeeked, | ||
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked, | ||
_ref2$onWebcamRequest = _ref2.onWebcamRequested, | ||
onWebcamRequested = _ref2$onWebcamRequest === void 0 ? function () {} : _ref2$onWebcamRequest, | ||
_ref2$onMicRequested = _ref2.onMicRequested, | ||
onMicRequested = _ref2$onMicRequested === void 0 ? function () {} : _ref2$onMicRequested, | ||
_ref2$onPinStateChang = _ref2.onPinStateChanged, | ||
onPinStateChanged = _ref2$onPinStateChang === void 0 ? function () {} : _ref2$onPinStateChang, | ||
_ref2$onConnectionOpe = _ref2.onConnectionOpen, | ||
onConnectionOpen = _ref2$onConnectionOpe === void 0 ? function () {} : _ref2$onConnectionOpe, | ||
_ref2$onConnetionClos = _ref2.onConnetionClose, | ||
onConnetionClose = _ref2$onConnetionClos === void 0 ? function () {} : _ref2$onConnetionClos, | ||
_ref2$onSwitchMeeting = _ref2.onSwitchMeeting, | ||
onSwitchMeeting = _ref2$onSwitchMeeting === void 0 ? function () {} : _ref2$onSwitchMeeting, | ||
_ref2$onError = _ref2.onError, | ||
onError = _ref2$onError === void 0 ? function () {} : _ref2$onError, | ||
_ref2$onHlsStarted = _ref2.onHlsStarted, | ||
onHlsStarted = _ref2$onHlsStarted === void 0 ? function () {} : _ref2$onHlsStarted, | ||
_ref2$onHlsStopped = _ref2.onHlsStopped, | ||
onHlsStopped = _ref2$onHlsStopped === void 0 ? function () {} : _ref2$onHlsStopped, | ||
_ref2$onHlsStateChang = _ref2.onHlsStateChanged, | ||
onHlsStateChanged = _ref2$onHlsStateChang === void 0 ? function () {} : _ref2$onHlsStateChang, | ||
_ref2$onRecordingStat = _ref2.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref2$onRecordingStat === void 0 ? function () {} : _ref2$onRecordingStat, | ||
_ref2$onLivestreamSta = _ref2.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref2$onLivestreamSta === void 0 ? function () {} : _ref2$onLivestreamSta, | ||
_ref2$onMeetingStateC = _ref2.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref2$onMeetingStateC === void 0 ? function () {} : _ref2$onMeetingStateC; | ||
_ref2$onParticipantJo = _ref2.onParticipantJoined, | ||
onParticipantJoined = _ref2$onParticipantJo === void 0 ? function () {} : _ref2$onParticipantJo, | ||
_ref2$onParticipantLe = _ref2.onParticipantLeft, | ||
onParticipantLeft = _ref2$onParticipantLe === void 0 ? function () {} : _ref2$onParticipantLe, | ||
_ref2$onSpeakerChange = _ref2.onSpeakerChanged, | ||
onSpeakerChanged = _ref2$onSpeakerChange === void 0 ? function () {} : _ref2$onSpeakerChange, | ||
_ref2$onPresenterChan = _ref2.onPresenterChanged, | ||
onPresenterChanged = _ref2$onPresenterChan === void 0 ? function () {} : _ref2$onPresenterChan, | ||
_ref2$onMainParticipa = _ref2.onMainParticipantChanged, | ||
onMainParticipantChanged = _ref2$onMainParticipa === void 0 ? function () {} : _ref2$onMainParticipa, | ||
_ref2$onEntryRequeste = _ref2.onEntryRequested, | ||
onEntryRequested = _ref2$onEntryRequeste === void 0 ? function () {} : _ref2$onEntryRequeste, | ||
_ref2$onEntryResponde = _ref2.onEntryResponded, | ||
onEntryResponded = _ref2$onEntryResponde === void 0 ? function () {} : _ref2$onEntryResponde, | ||
_ref2$onRecordingStar = _ref2.onRecordingStarted, | ||
onRecordingStarted = _ref2$onRecordingStar === void 0 ? function () {} : _ref2$onRecordingStar, | ||
_ref2$onRecordingStop = _ref2.onRecordingStopped, | ||
onRecordingStopped = _ref2$onRecordingStop === void 0 ? function () {} : _ref2$onRecordingStop, | ||
_ref2$onChatMessage = _ref2.onChatMessage, | ||
onChatMessage = _ref2$onChatMessage === void 0 ? function () {} : _ref2$onChatMessage, | ||
_ref2$onMeetingJoined = _ref2.onMeetingJoined, | ||
onMeetingJoined = _ref2$onMeetingJoined === void 0 ? function () {} : _ref2$onMeetingJoined, | ||
_ref2$onMeetingLeft = _ref2.onMeetingLeft, | ||
onMeetingLeft = _ref2$onMeetingLeft === void 0 ? function () {} : _ref2$onMeetingLeft, | ||
_ref2$onLiveStreamSta = _ref2.onLiveStreamStarted, | ||
onLiveStreamStarted = _ref2$onLiveStreamSta === void 0 ? function () {} : _ref2$onLiveStreamSta, | ||
_ref2$onLiveStreamSto = _ref2.onLiveStreamStopped, | ||
onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto, | ||
_ref2$onVideoStateCha = _ref2.onVideoStateChanged, | ||
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha, | ||
_ref2$onVideoSeeked = _ref2.onVideoSeeked, | ||
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked, | ||
_ref2$onWebcamRequest = _ref2.onWebcamRequested, | ||
onWebcamRequested = _ref2$onWebcamRequest === void 0 ? function () {} : _ref2$onWebcamRequest, | ||
_ref2$onMicRequested = _ref2.onMicRequested, | ||
onMicRequested = _ref2$onMicRequested === void 0 ? function () {} : _ref2$onMicRequested, | ||
_ref2$onPinStateChang = _ref2.onPinStateChanged, | ||
onPinStateChanged = _ref2$onPinStateChang === void 0 ? function () {} : _ref2$onPinStateChang, | ||
_ref2$onConnectionOpe = _ref2.onConnectionOpen, | ||
onConnectionOpen = _ref2$onConnectionOpe === void 0 ? function () {} : _ref2$onConnectionOpe, | ||
_ref2$onConnetionClos = _ref2.onConnetionClose, | ||
onConnetionClose = _ref2$onConnetionClos === void 0 ? function () {} : _ref2$onConnetionClos, | ||
_ref2$onSwitchMeeting = _ref2.onSwitchMeeting, | ||
onSwitchMeeting = _ref2$onSwitchMeeting === void 0 ? function () {} : _ref2$onSwitchMeeting, | ||
_ref2$onError = _ref2.onError, | ||
onError = _ref2$onError === void 0 ? function () {} : _ref2$onError, | ||
_ref2$onHlsStarted = _ref2.onHlsStarted, | ||
onHlsStarted = _ref2$onHlsStarted === void 0 ? function () {} : _ref2$onHlsStarted, | ||
_ref2$onHlsStopped = _ref2.onHlsStopped, | ||
onHlsStopped = _ref2$onHlsStopped === void 0 ? function () {} : _ref2$onHlsStopped, | ||
_ref2$onHlsStateChang = _ref2.onHlsStateChanged, | ||
onHlsStateChanged = _ref2$onHlsStateChang === void 0 ? function () {} : _ref2$onHlsStateChang, | ||
_ref2$onRecordingStat = _ref2.onRecordingStateChanged, | ||
onRecordingStateChanged = _ref2$onRecordingStat === void 0 ? function () {} : _ref2$onRecordingStat, | ||
_ref2$onLivestreamSta = _ref2.onLivestreamStateChanged, | ||
onLivestreamStateChanged = _ref2$onLivestreamSta === void 0 ? function () {} : _ref2$onLivestreamSta, | ||
_ref2$onMeetingStateC = _ref2.onMeetingStateChanged, | ||
onMeetingStateChanged = _ref2$onMeetingStateC === void 0 ? function () {} : _ref2$onMeetingStateC; | ||
useEffect(function () { | ||
@@ -297,84 +297,64 @@ eventEmitter.on(events['meeting-state-changed'], onMeetingStateChanged); | ||
var children = _ref.children, | ||
config = _ref.config, | ||
token = _ref.token, | ||
joinWithoutUserInteraction = _ref.joinWithoutUserInteraction, | ||
_reinitialiseMeetingOnConfigChange = _ref.reinitialiseMeetingOnConfigChange, | ||
deviceInfo = _ref.deviceInfo; | ||
config = _ref.config, | ||
token = _ref.token, | ||
joinWithoutUserInteraction = _ref.joinWithoutUserInteraction, | ||
_reinitialiseMeetingOnConfigChange = _ref.reinitialiseMeetingOnConfigChange, | ||
deviceInfo = _ref.deviceInfo; | ||
var _useState = useState(null), | ||
meeting = _useState[0], | ||
setMeeting = _useState[1]; | ||
meeting = _useState[0], | ||
setMeeting = _useState[1]; | ||
var _useState2 = useState(null), | ||
localParticipant = _useState2[0], | ||
setLocalParticipant = _useState2[1]; | ||
localParticipant = _useState2[0], | ||
setLocalParticipant = _useState2[1]; | ||
var _useState3 = useState(null), | ||
mainParticipant = _useState3[0], | ||
setMainParticipant = _useState3[1]; | ||
mainParticipant = _useState3[0], | ||
setMainParticipant = _useState3[1]; | ||
var _useState4 = useState(null), | ||
activeSpeakerId = _useState4[0], | ||
setActiveSpeakerId = _useState4[1]; | ||
activeSpeakerId = _useState4[0], | ||
setActiveSpeakerId = _useState4[1]; | ||
var _useState5 = useState(null), | ||
presenterId = _useState5[0], | ||
setPresenterId = _useState5[1]; | ||
presenterId = _useState5[0], | ||
setPresenterId = _useState5[1]; | ||
var _useState6 = useState(false), | ||
localMicOn = _useState6[0], | ||
setLocalMicOn = _useState6[1]; | ||
localMicOn = _useState6[0], | ||
setLocalMicOn = _useState6[1]; | ||
var _useState7 = useState(false), | ||
localWebcamOn = _useState7[0], | ||
setLocalWebcamOn = _useState7[1]; | ||
localWebcamOn = _useState7[0], | ||
setLocalWebcamOn = _useState7[1]; | ||
var _useState8 = useState(false), | ||
localScreenShareOn = _useState8[0], | ||
setLocalScreenShareOn = _useState8[1]; | ||
localScreenShareOn = _useState8[0], | ||
setLocalScreenShareOn = _useState8[1]; | ||
var _useState9 = useState(false), | ||
isRecording = _useState9[0], | ||
setIsRecording = _useState9[1]; | ||
isRecording = _useState9[0], | ||
setIsRecording = _useState9[1]; | ||
var _useState10 = useState([]), | ||
messages = _useState10[0], | ||
setMessages = _useState10[1]; | ||
messages = _useState10[0], | ||
setMessages = _useState10[1]; | ||
var _useState11 = useState(new Map()), | ||
participants = _useState11[0], | ||
setParticipants = _useState11[1]; | ||
participants = _useState11[0], | ||
setParticipants = _useState11[1]; | ||
var _useState12 = useState(new Map()), | ||
pinnedParticipants = _useState12[0], | ||
setPinnedParticipants = _useState12[1]; | ||
pinnedParticipants = _useState12[0], | ||
setPinnedParticipants = _useState12[1]; | ||
var _useState13 = useState(false), | ||
isLiveStreaming = _useState13[0], | ||
setIsLiveStreaming = _useState13[1]; | ||
isLiveStreaming = _useState13[0], | ||
setIsLiveStreaming = _useState13[1]; | ||
var _useState14 = useState(new Map()), | ||
connections = _useState14[0], | ||
setConnections = _useState14[1]; | ||
connections = _useState14[0], | ||
setConnections = _useState14[1]; | ||
var _useState15 = useState(false), | ||
isMeetingJoined = _useState15[0], | ||
setIsMeetingJoined = _useState15[1]; | ||
isMeetingJoined = _useState15[0], | ||
setIsMeetingJoined = _useState15[1]; | ||
var _useState16 = useState(false), | ||
isHls = _useState16[0], | ||
setIsHls = _useState16[1]; | ||
isHls = _useState16[0], | ||
setIsHls = _useState16[1]; | ||
var _useState17 = useState(null), | ||
recordingState = _useState17[0], | ||
setRecordingState = _useState17[1]; | ||
recordingState = _useState17[0], | ||
setRecordingState = _useState17[1]; | ||
var _useState18 = useState(null), | ||
livestreamState = _useState18[0], | ||
setLivestreamState = _useState18[1]; | ||
livestreamState = _useState18[0], | ||
setLivestreamState = _useState18[1]; | ||
var _useState19 = useState(null), | ||
hlsState = _useState19[0], | ||
setHlsState = _useState19[1]; | ||
hlsState = _useState19[0], | ||
setHlsState = _useState19[1]; | ||
var meetingRef = useRef(); | ||
@@ -416,3 +396,2 @@ var localMicOnRef = useRef(); | ||
}, [isHls]); | ||
var resetStates = function resetStates() { | ||
@@ -439,3 +418,2 @@ setMeeting(null); | ||
}; | ||
var _handle_participant_joined = function _handle_participant_joined(participant) { | ||
@@ -449,3 +427,2 @@ setParticipants(function (participants) { | ||
}; | ||
var _handle_participant_left = function _handle_participant_left(participant) { | ||
@@ -459,6 +436,4 @@ setParticipants(function (participants) { | ||
}; | ||
var _handle_presenter_changed = function _handle_presenter_changed(presenterId) { | ||
var _meetingRef$current, _meetingRef$current$l; | ||
setPresenterId(presenterId); | ||
@@ -468,3 +443,2 @@ 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)); | ||
}; | ||
var _handle_main_participant_changed = function _handle_main_participant_changed(participant) { | ||
@@ -474,3 +448,2 @@ setMainParticipant(participant); | ||
}; | ||
var _handle_speaker_changed = function _handle_speaker_changed(activeSpeakerId) { | ||
@@ -480,3 +453,2 @@ setActiveSpeakerId(activeSpeakerId); | ||
}; | ||
var _handle_chat_message = function _handle_chat_message(data) { | ||
@@ -488,11 +460,8 @@ setMessages(function (s) { | ||
}; | ||
var _handle_entry_requested = function _handle_entry_requested(data) { | ||
eventEmitter.emit(events['entry-requested'], data); | ||
}; | ||
var _handle_entry_responded = function _handle_entry_responded(participantId, decision) { | ||
eventEmitter.emit(events['entry-responded'], participantId, decision); | ||
}; | ||
var _handle_recording_started = function _handle_recording_started() { | ||
@@ -502,3 +471,2 @@ setIsRecording(true); | ||
}; | ||
var _handle_recording_stopped = function _handle_recording_stopped() { | ||
@@ -508,3 +476,2 @@ setIsRecording(false); | ||
}; | ||
var _handle_localParticipant_stream_enabled = function _handle_localParticipant_stream_enabled(stream) { | ||
@@ -519,3 +486,2 @@ if (stream.track.readyState === 'live') { | ||
}; | ||
var _handle_localParticipant_stream_disabled = function _handle_localParticipant_stream_disabled(stream) { | ||
@@ -530,3 +496,2 @@ if (stream.track.readyState === 'ended') { | ||
}; | ||
var _handle_live_stream_started = function _handle_live_stream_started(data) { | ||
@@ -536,3 +501,2 @@ setIsLiveStreaming(true); | ||
}; | ||
var _handle_live_stream_stopped = function _handle_live_stream_stopped() { | ||
@@ -542,3 +506,2 @@ setIsLiveStreaming(false); | ||
}; | ||
var _handle_hls_started = function _handle_hls_started(data) { | ||
@@ -548,3 +511,2 @@ setIsHls(true); | ||
}; | ||
var _handle_hls_stopped = function _handle_hls_stopped() { | ||
@@ -554,19 +516,14 @@ setIsHls(false); | ||
}; | ||
var _handle_video_state_changed = function _handle_video_state_changed(data) { | ||
eventEmitter.emit(events['video-state-changed'], data); | ||
}; | ||
var _handle_video_seeked = function _handle_video_seeked(data) { | ||
eventEmitter.emit(events['video-seeked'], data); | ||
}; | ||
var _handle_webcam_requested = function _handle_webcam_requested(data) { | ||
eventEmitter.emit(events['webcam-requested'], data); | ||
}; | ||
var _handle_mic_requested = function _handle_mic_requested(data) { | ||
eventEmitter.emit(events['mic-requested'], data); | ||
}; | ||
var _handle_meeting_joined = function _handle_meeting_joined(data) { | ||
@@ -580,10 +537,7 @@ joinedOnFirstRender.current = true; | ||
}; | ||
var _handle_meeting_left = function _handle_meeting_left() { | ||
eventEmitter.emit(events['meeting-left']); | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
var _meeting$localPartici; | ||
if (typeof (meeting === null || meeting === void 0 ? void 0 : meeting.off) === 'function') { | ||
@@ -620,3 +574,2 @@ meeting.off('meeting-state-changed', _handle_meeting_state_changed); | ||
} | ||
if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') { | ||
@@ -626,11 +579,9 @@ meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled); | ||
} | ||
resetStates(); | ||
} | ||
}; | ||
var _handle_pin_state_changed = function _handle_pin_state_changed(_ref2) { | ||
var participantId = _ref2.participantId, | ||
state = _ref2.state, | ||
pinnedBy = _ref2.pinnedBy; | ||
state = _ref2.state, | ||
pinnedBy = _ref2.pinnedBy; | ||
setPinnedParticipants(function (pinnedParticipants) { | ||
@@ -642,3 +593,2 @@ if (!state.cam && !state.share) { | ||
} | ||
var pinnedParticipantsToSet = new Map(pinnedParticipants); | ||
@@ -653,3 +603,2 @@ return pinnedParticipantsToSet; | ||
}; | ||
var _handle_connection_open = function _handle_connection_open(connection) { | ||
@@ -663,3 +612,2 @@ setConnections(function (s) { | ||
}; | ||
var _handle_connection_close = function _handle_connection_close(connectionId) { | ||
@@ -673,11 +621,8 @@ setConnections(function (s) { | ||
}; | ||
var _handle_switch_meeting = function _handle_switch_meeting(d) { | ||
eventEmitter.emit(events['switch-meeting'], d); | ||
}; | ||
var _handle_error = function _handle_error(data) { | ||
eventEmitter.emit(events['error'], data); | ||
}; | ||
var _handle_recording_state_changed = function _handle_recording_state_changed(data) { | ||
@@ -687,3 +632,2 @@ setRecordingState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_livestream_state_changed = function _handle_livestream_state_changed(data) { | ||
@@ -693,3 +637,2 @@ setLivestreamState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_hls_state_changed = function _handle_hls_state_changed(data) { | ||
@@ -699,7 +642,5 @@ setHlsState(data === null || data === void 0 ? void 0 : data.status); | ||
}; | ||
var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) { | ||
eventEmitter.emit(events['meeting-state-changed'], data); | ||
}; | ||
var join = function join() { | ||
@@ -709,3 +650,3 @@ var meeting = VideoSDK && VideoSDK.initMeeting(configRef.current); | ||
var localParticipant = meeting.localParticipant, | ||
participants = meeting.participants; | ||
participants = meeting.participants; | ||
participants.set(localParticipant.id, localParticipant); | ||
@@ -747,6 +688,4 @@ setParticipants(participants); | ||
}; | ||
var leave = function leave() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -756,6 +695,4 @@ meeting.leave(); | ||
}; | ||
var end = function end() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -765,6 +702,4 @@ meeting.end(); | ||
}; | ||
var startRecording = function startRecording(webhookUrl, awsDirPath, config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -774,9 +709,6 @@ meeting.startRecording(webhookUrl, awsDirPath, config); | ||
}; | ||
var stopRecording = function stopRecording() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
var _isRecording = isRecordingRef.current; | ||
if (_isRecording) { | ||
@@ -787,3 +719,2 @@ meeting.stopRecording(); | ||
}; | ||
var unmuteMic = function unmuteMic(customAudioTrack) { | ||
@@ -793,5 +724,3 @@ if (customAudioTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -801,6 +730,4 @@ meeting.unmuteMic(customAudioTrack); | ||
}; | ||
var muteMic = function muteMic() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -810,3 +737,2 @@ meeting.muteMic(); | ||
}; | ||
var toggleMic = function toggleMic(customAudioTrack) { | ||
@@ -816,5 +742,3 @@ if (customAudioTrack === void 0) { | ||
} | ||
var localMicOn = localMicOnRef.current; | ||
if (localMicOn) { | ||
@@ -826,6 +750,4 @@ muteMic(); | ||
}; | ||
var disableWebcam = function disableWebcam() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -835,3 +757,2 @@ meeting.disableWebcam(); | ||
}; | ||
var enableWebcam = function enableWebcam(customVideoTrack) { | ||
@@ -841,5 +762,3 @@ if (customVideoTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -849,3 +768,2 @@ meeting.enableWebcam(customVideoTrack); | ||
}; | ||
var toggleWebcam = function toggleWebcam(customVideoTrack) { | ||
@@ -855,5 +773,3 @@ if (customVideoTrack === void 0) { | ||
} | ||
var localWebcamOn = localWebcamOnRef.current; | ||
if (localWebcamOn) { | ||
@@ -865,6 +781,4 @@ disableWebcam(); | ||
}; | ||
var disableScreenShare = function disableScreenShare() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -874,3 +788,2 @@ meeting.disableScreenShare(); | ||
}; | ||
var enableScreenShare = function enableScreenShare(customScreenShareTrack) { | ||
@@ -880,5 +793,3 @@ if (customScreenShareTrack === void 0) { | ||
} | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -888,3 +799,2 @@ meeting.enableScreenShare(customScreenShareTrack); | ||
}; | ||
var toggleScreenShare = function toggleScreenShare(customScreenShareTrack) { | ||
@@ -894,5 +804,3 @@ if (customScreenShareTrack === void 0) { | ||
} | ||
var localScreenShareOn = localScreenShareOnRef.current; | ||
if (localScreenShareOn) { | ||
@@ -904,6 +812,4 @@ disableScreenShare(); | ||
}; | ||
var sendChatMessage = function sendChatMessage(text) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -913,6 +819,4 @@ meeting.sendChatMessage(text); | ||
}; | ||
var respondEntry = function respondEntry(participantId, decision) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -922,3 +826,2 @@ meeting.respondEntry(participantId, decision); | ||
}; | ||
var getMics = function getMics() { | ||
@@ -936,3 +839,2 @@ try { | ||
}; | ||
var getWebcams = function getWebcams() { | ||
@@ -950,6 +852,4 @@ try { | ||
}; | ||
var changeWebcam = function changeWebcam(obj) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -959,6 +859,4 @@ meeting.changeWebcam(obj); | ||
}; | ||
var changeMic = function changeMic(obj) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -968,7 +866,5 @@ meeting.changeMic(obj); | ||
}; | ||
var startVideo = function startVideo(_ref3) { | ||
var link = _ref3.link; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -980,6 +876,4 @@ meeting.startVideo({ | ||
}; | ||
var stopVideo = function stopVideo() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -989,6 +883,4 @@ meeting.stopVideo(); | ||
}; | ||
var resumeVideo = function resumeVideo() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -998,7 +890,5 @@ meeting.resumeVideo(); | ||
}; | ||
var pauseVideo = function pauseVideo(_ref4) { | ||
var currentTime = _ref4.currentTime; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1010,7 +900,5 @@ meeting.pauseVideo({ | ||
}; | ||
var seekVideo = function seekVideo(_ref5) { | ||
var currentTime = _ref5.currentTime; | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1022,6 +910,4 @@ meeting.seekVideo({ | ||
}; | ||
var startLivestream = function startLivestream(streamInfo, config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1031,6 +917,4 @@ meeting.startLivestream(streamInfo, config); | ||
}; | ||
var stopLivestream = function stopLivestream() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1040,10 +924,7 @@ meeting.stopLivestream(); | ||
}; | ||
var connectTo = function connectTo(_ref6) { | ||
var meetingId = _ref6.meetingId, | ||
payload = _ref6.payload; | ||
payload = _ref6.payload; | ||
try { | ||
var _meeting3 = meetingRef.current; | ||
var _temp2 = function () { | ||
@@ -1057,3 +938,2 @@ if (_meeting3) { | ||
}(); | ||
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0); | ||
@@ -1064,6 +944,4 @@ } catch (e) { | ||
}; | ||
var startHls = function startHls(config) { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1073,6 +951,4 @@ meeting.startHls(config); | ||
}; | ||
var stopHls = function stopHls() { | ||
var meeting = meetingRef.current; | ||
if (meeting) { | ||
@@ -1082,6 +958,4 @@ meeting.stopHls(); | ||
}; | ||
var initSDK = function initSDK() { | ||
VideoSDK.config(tokenRef.current); | ||
if (deviceInfo) { | ||
@@ -1095,3 +969,2 @@ VideoSDK.analytics(deviceInfo); | ||
} | ||
if (joinWithoutUserInteraction) { | ||
@@ -1101,3 +974,2 @@ join(); | ||
}; | ||
useEffect(function () { | ||
@@ -1172,64 +1044,55 @@ initSDK(); | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onStreamEnabled = _ref.onStreamEnabled, | ||
onStreamEnabled = _ref$onStreamEnabled === void 0 ? function () {} : _ref$onStreamEnabled, | ||
_ref$onStreamDisabled = _ref.onStreamDisabled, | ||
onStreamDisabled = _ref$onStreamDisabled === void 0 ? function () {} : _ref$onStreamDisabled, | ||
_ref$onMediaStatusCha = _ref.onMediaStatusChanged, | ||
onMediaStatusChanged = _ref$onMediaStatusCha === void 0 ? function () {} : _ref$onMediaStatusCha, | ||
_ref$onVideoQualityCh = _ref.onVideoQualityChanged, | ||
onVideoQualityChanged = _ref$onVideoQualityCh === void 0 ? function () {} : _ref$onVideoQualityCh; | ||
_ref$onStreamEnabled = _ref.onStreamEnabled, | ||
onStreamEnabled = _ref$onStreamEnabled === void 0 ? function () {} : _ref$onStreamEnabled, | ||
_ref$onStreamDisabled = _ref.onStreamDisabled, | ||
onStreamDisabled = _ref$onStreamDisabled === void 0 ? function () {} : _ref$onStreamDisabled, | ||
_ref$onMediaStatusCha = _ref.onMediaStatusChanged, | ||
onMediaStatusChanged = _ref$onMediaStatusCha === void 0 ? function () {} : _ref$onMediaStatusCha, | ||
_ref$onVideoQualityCh = _ref.onVideoQualityChanged, | ||
onVideoQualityChanged = _ref$onVideoQualityCh === void 0 ? function () {} : _ref$onVideoQualityCh; | ||
var _useState = useState(null), | ||
webcamStream = _useState[0], | ||
setwebcamStream = _useState[1]; | ||
webcamStream = _useState[0], | ||
setwebcamStream = _useState[1]; | ||
var _useState2 = useState(null), | ||
micStream = _useState2[0], | ||
setMicStream = _useState2[1]; | ||
micStream = _useState2[0], | ||
setMicStream = _useState2[1]; | ||
var _useState3 = useState(null), | ||
screenShareStream = _useState3[0], | ||
setScreenShareStream = _useState3[1]; | ||
screenShareStream = _useState3[0], | ||
setScreenShareStream = _useState3[1]; | ||
var _useState4 = useState(null), | ||
screenShareAudioStream = _useState4[0], | ||
setScreenShareAudioStream = _useState4[1]; | ||
screenShareAudioStream = _useState4[0], | ||
setScreenShareAudioStream = _useState4[1]; | ||
var meeting = useMeeting(); | ||
var _useMemo = useMemo(function () { | ||
var _meeting$pinnedPartic; | ||
var _meeting$pinnedPartic; | ||
var participants = meeting === null || meeting === void 0 ? void 0 : meeting.participants; | ||
var localParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.localParticipant; | ||
var activeSpeakerId = meeting === null || meeting === void 0 ? void 0 : meeting.activeSpeakerId; | ||
var mainParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.mainParticipant; | ||
var pinState = (meeting === null || meeting === void 0 ? void 0 : (_meeting$pinnedPartic = meeting.pinnedParticipants) === null || _meeting$pinnedPartic === void 0 ? void 0 : _meeting$pinnedPartic.get(participantId)) || { | ||
cam: false, | ||
share: false | ||
}; | ||
var participants = meeting === null || meeting === void 0 ? void 0 : meeting.participants; | ||
var localParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.localParticipant; | ||
var activeSpeakerId = meeting === null || meeting === void 0 ? void 0 : meeting.activeSpeakerId; | ||
var mainParticipant = meeting === null || meeting === void 0 ? void 0 : meeting.mainParticipant; | ||
var pinState = (meeting === null || meeting === void 0 ? void 0 : (_meeting$pinnedPartic = meeting.pinnedParticipants) === null || _meeting$pinnedPartic === void 0 ? void 0 : _meeting$pinnedPartic.get(participantId)) || { | ||
cam: false, | ||
share: false | ||
}; | ||
return { | ||
participants: participants, | ||
localParticipant: localParticipant, | ||
activeSpeakerId: activeSpeakerId, | ||
mainParticipant: mainParticipant, | ||
pinState: pinState | ||
}; | ||
}, [meeting]), | ||
participants = _useMemo.participants, | ||
localParticipant = _useMemo.localParticipant, | ||
activeSpeakerId = _useMemo.activeSpeakerId, | ||
mainParticipant = _useMemo.mainParticipant, | ||
pinState = _useMemo.pinState; | ||
return { | ||
participants: participants, | ||
localParticipant: localParticipant, | ||
activeSpeakerId: activeSpeakerId, | ||
mainParticipant: mainParticipant, | ||
pinState: pinState | ||
}; | ||
}, [meeting]), | ||
participants = _useMemo.participants, | ||
localParticipant = _useMemo.localParticipant, | ||
activeSpeakerId = _useMemo.activeSpeakerId, | ||
mainParticipant = _useMemo.mainParticipant, | ||
pinState = _useMemo.pinState; | ||
var participant = participants === null || participants === void 0 ? void 0 : participants.get(participantId); | ||
var _useState5 = useState(participant === null || participant === void 0 ? void 0 : participant.webcamOn), | ||
webcamOn = _useState5[0], | ||
setWebcamOn = _useState5[1]; | ||
webcamOn = _useState5[0], | ||
setWebcamOn = _useState5[1]; | ||
var _useState6 = useState(participant === null || participant === void 0 ? void 0 : participant.micOn), | ||
micOn = _useState6[0], | ||
setMicOn = _useState6[1]; | ||
micOn = _useState6[0], | ||
setMicOn = _useState6[1]; | ||
var setTrack = function setTrack(stream) { | ||
@@ -1241,11 +1104,8 @@ if (stream.track.readyState === 'live') { | ||
break; | ||
case 'audio': | ||
setMicStream(stream); | ||
break; | ||
case 'share': | ||
setScreenShareStream(stream); | ||
break; | ||
case 'shareAudio': | ||
@@ -1257,3 +1117,2 @@ setScreenShareAudioStream(stream); | ||
}; | ||
var unSetTrack = function unSetTrack(stream) { | ||
@@ -1265,11 +1124,8 @@ if (stream.track.readyState !== 'live') { | ||
break; | ||
case 'audio': | ||
setMicStream(null); | ||
break; | ||
case 'share': | ||
setScreenShareStream(null); | ||
break; | ||
case 'shareAudio': | ||
@@ -1281,3 +1137,2 @@ setScreenShareAudioStream(null); | ||
}; | ||
var _handleStreamEnabled = function _handleStreamEnabled(stream) { | ||
@@ -1287,3 +1142,2 @@ setTrack(stream); | ||
}; | ||
var _handleStreamDisabled = function _handleStreamDisabled(stream) { | ||
@@ -1293,7 +1147,6 @@ unSetTrack(stream); | ||
}; | ||
var _handleVideoQualityChanged = function _handleVideoQualityChanged(data) { | ||
var peerId = data.peerId, | ||
prevQuality = data.prevQuality, | ||
currentQuality = data.currentQuality; | ||
prevQuality = data.prevQuality, | ||
currentQuality = data.currentQuality; | ||
onVideoQualityChanged({ | ||
@@ -1305,8 +1158,6 @@ peerId: peerId, | ||
}; | ||
var _handleMediaStatusChanged = function _handleMediaStatusChanged(data) { | ||
var kind = data.kind, | ||
peerId = data.peerId, | ||
newStatus = data.newStatus; | ||
peerId = data.peerId, | ||
newStatus = data.newStatus; | ||
if (kind == 'audio') { | ||
@@ -1317,3 +1168,2 @@ setMicOn(newStatus); | ||
} | ||
onMediaStatusChanged({ | ||
@@ -1325,66 +1175,52 @@ kind: kind, | ||
}; | ||
var setQuality = function setQuality(quality) { | ||
participant === null || participant === void 0 ? void 0 : participant.setQuality(quality); | ||
}; | ||
var setViewPort = function setViewPort(width, height) { | ||
participant === null || participant === void 0 ? void 0 : participant.setViewPort(width, height); | ||
}; | ||
var enableMic = function enableMic() { | ||
participant === null || participant === void 0 ? void 0 : participant.enableMic(); | ||
}; | ||
var disableMic = function disableMic() { | ||
participant === null || participant === void 0 ? void 0 : participant.disableMic(); | ||
}; | ||
var enableWebcam = function enableWebcam() { | ||
participant === null || participant === void 0 ? void 0 : participant.enableWebcam(); | ||
}; | ||
var disableWebcam = function disableWebcam() { | ||
participant === null || participant === void 0 ? void 0 : participant.disableWebcam(); | ||
}; | ||
var pin = function pin(data) { | ||
participant === null || participant === void 0 ? void 0 : participant.pin(data); | ||
}; | ||
var unpin = function unpin(data) { | ||
participant === null || participant === void 0 ? void 0 : participant.unpin(data); | ||
}; | ||
var getAudioStats = function getAudioStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats()); | ||
}; | ||
var getVideoStats = function getVideoStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getVideoStats()); | ||
}; | ||
var getShareStats = function getShareStats() { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getShareStats()); | ||
}; | ||
var consumeWebcamStreams = function consumeWebcamStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.consumeWebcamStreams(); | ||
}; | ||
var consumeMicStreams = function consumeMicStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.consumeMicStreams(); | ||
}; | ||
var stopConsumingWebcamStreams = function stopConsumingWebcamStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.stopConsumingWebcamStreams(); | ||
}; | ||
var stopConsumingMicStreams = function stopConsumingMicStreams() { | ||
participant === null || participant === void 0 ? void 0 : participant.stopConsumingMicStreams(); | ||
}; | ||
var switchTo = function switchTo(data) { | ||
return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.switchTo(data)).then(function () {}); | ||
}; | ||
useEffect(function () { | ||
var streams = participant === null || participant === void 0 ? void 0 : participant.streams; | ||
if (streams) { | ||
@@ -1395,11 +1231,8 @@ streams.forEach(function (stream) { | ||
} | ||
if (participant !== null && participant !== void 0 && participant.micOn) { | ||
setMicOn(micOn); | ||
} | ||
if (participant !== null && participant !== void 0 && participant.webcamOn) { | ||
setWebcamOn(webcamOn); | ||
} | ||
participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled); | ||
@@ -1445,3 +1278,4 @@ participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled); | ||
getAudioStats: getAudioStats, | ||
getVideoStats: getVideoStats | ||
getVideoStats: getVideoStats, | ||
getShareStats: getShareStats | ||
}; | ||
@@ -1452,10 +1286,9 @@ }; | ||
var _ref = _temp === void 0 ? { | ||
onMeeting: { | ||
onParticipantJoined: function onParticipantJoined() {}, | ||
onParticipantLeft: function onParticipantLeft() {}, | ||
onChatMessage: function onChatMessage() {} | ||
} | ||
} : _temp, | ||
onMeeting = _ref.onMeeting; | ||
onMeeting: { | ||
onParticipantJoined: function onParticipantJoined() {}, | ||
onParticipantLeft: function onParticipantLeft() {}, | ||
onChatMessage: function onChatMessage() {} | ||
} | ||
} : _temp, | ||
onMeeting = _ref.onMeeting; | ||
var onParticipantJoined = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantJoined; | ||
@@ -1465,23 +1298,18 @@ var onParticipantLeft = onMeeting === null || onMeeting === void 0 ? void 0 : onMeeting.onParticipantLeft; | ||
var meeting = useMeeting(); | ||
var _useMemo = useMemo(function () { | ||
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId); | ||
if (!connection) { | ||
throw new Error('connectionId not found'); | ||
} | ||
var connectionParticipants = new Map(connection.meeting.participants); | ||
return { | ||
connection: connection, | ||
connectionParticipants: connectionParticipants | ||
}; | ||
}, [meeting]), | ||
connection = _useMemo.connection, | ||
connectionParticipants = _useMemo.connectionParticipants; | ||
var connection = meeting === null || meeting === void 0 ? void 0 : meeting.connections.get(connectionId); | ||
if (!connection) { | ||
throw new Error('connectionId not found'); | ||
} | ||
var connectionParticipants = new Map(connection.meeting.participants); | ||
return { | ||
connection: connection, | ||
connectionParticipants: connectionParticipants | ||
}; | ||
}, [meeting]), | ||
connection = _useMemo.connection, | ||
connectionParticipants = _useMemo.connectionParticipants; | ||
var _useState = useState(new Map(connectionParticipants)), | ||
_connectionParticipants = _useState[0], | ||
setConnectionParticipants = _useState[1]; | ||
_connectionParticipants = _useState[0], | ||
setConnectionParticipants = _useState[1]; | ||
var _handleParticipantJoined = function _handleParticipantJoined(participant) { | ||
@@ -1495,3 +1323,2 @@ setConnectionParticipants(function (s) { | ||
}; | ||
var _handleParticipantLeft = function _handleParticipantLeft(participantId) { | ||
@@ -1505,7 +1332,5 @@ setConnectionParticipants(function (s) { | ||
}; | ||
var _handleChatMessage = function _handleChatMessage(data) { | ||
onChatMessage(data); | ||
}; | ||
useEffect(function () { | ||
@@ -1538,15 +1363,12 @@ connection === null || connection === void 0 ? void 0 : connection.meeting.on('participant-joined', _handleParticipantJoined); | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
_ref$onMessageReceive = _ref.onMessageReceived, | ||
onMessageReceived = _ref$onMessageReceive === void 0 ? function () {} : _ref$onMessageReceive, | ||
_ref$onOldMessagesRec = _ref.onOldMessagesReceived, | ||
onOldMessagesReceived = _ref$onOldMessagesRec === void 0 ? function () {} : _ref$onOldMessagesRec; | ||
_ref$onMessageReceive = _ref.onMessageReceived, | ||
onMessageReceived = _ref$onMessageReceive === void 0 ? function () {} : _ref$onMessageReceive, | ||
_ref$onOldMessagesRec = _ref.onOldMessagesReceived, | ||
onOldMessagesReceived = _ref$onOldMessagesRec === void 0 ? function () {} : _ref$onOldMessagesRec; | ||
var _useMeeting = useMeeting(), | ||
meeting = _useMeeting.meeting, | ||
isMeetingJoined = _useMeeting.isMeetingJoined; | ||
meeting = _useMeeting.meeting, | ||
isMeetingJoined = _useMeeting.isMeetingJoined; | ||
var _useState = useState([]), | ||
messages = _useState[0], | ||
setMessages = _useState[1]; | ||
messages = _useState[0], | ||
setMessages = _useState[1]; | ||
var isSubscribed = useRef(false); | ||
@@ -1559,3 +1381,2 @@ | ||
}; | ||
var _handlePubSub = function _handlePubSub(data) { | ||
@@ -1567,7 +1388,5 @@ setMessages(function (s) { | ||
}; | ||
var subscribeToPubsub = function subscribeToPubsub(meeting) { | ||
try { | ||
var _meeting$pubSub; | ||
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) { | ||
@@ -1583,3 +1402,2 @@ if (data) { | ||
}; | ||
useEffect(function () { | ||
@@ -1591,3 +1409,2 @@ if (meeting && !isSubscribed.current && isMeetingJoined) { | ||
var _meeting$pubSub2; | ||
meeting === null || meeting === void 0 ? void 0 : (_meeting$pubSub2 = meeting.pubSub) === null || _meeting$pubSub2 === void 0 ? void 0 : _meeting$pubSub2.unsubscribe(topic, _handlePubSub); | ||
@@ -1607,12 +1424,11 @@ }; | ||
var _ref$cameraId = _ref.cameraId, | ||
cameraId = _ref$cameraId === void 0 ? undefined : _ref$cameraId, | ||
_ref$encoderConfig = _ref.encoderConfig, | ||
encoderConfig = _ref$encoderConfig === void 0 ? undefined : _ref$encoderConfig, | ||
_ref$facingMode = _ref.facingMode, | ||
facingMode = _ref$facingMode === void 0 ? undefined : _ref$facingMode, | ||
_ref$optimizationMode = _ref.optimizationMode, | ||
optimizationMode = _ref$optimizationMode === void 0 ? undefined : _ref$optimizationMode, | ||
_ref$multiStream = _ref.multiStream, | ||
multiStream = _ref$multiStream === void 0 ? true : _ref$multiStream; | ||
cameraId = _ref$cameraId === void 0 ? undefined : _ref$cameraId, | ||
_ref$encoderConfig = _ref.encoderConfig, | ||
encoderConfig = _ref$encoderConfig === void 0 ? undefined : _ref$encoderConfig, | ||
_ref$facingMode = _ref.facingMode, | ||
facingMode = _ref$facingMode === void 0 ? undefined : _ref$facingMode, | ||
_ref$optimizationMode = _ref.optimizationMode, | ||
optimizationMode = _ref$optimizationMode === void 0 ? undefined : _ref$optimizationMode, | ||
_ref$multiStream = _ref.multiStream, | ||
multiStream = _ref$multiStream === void 0 ? true : _ref$multiStream; | ||
try { | ||
@@ -1633,8 +1449,7 @@ return Promise.resolve(VideoSDK.createCameraVideoTrack({ | ||
var _ref2$encoderConfig = _ref2.encoderConfig, | ||
encoderConfig = _ref2$encoderConfig === void 0 ? undefined : _ref2$encoderConfig, | ||
_ref2$optimizationMod = _ref2.optimizationMode, | ||
optimizationMode = _ref2$optimizationMod === void 0 ? undefined : _ref2$optimizationMod, | ||
_ref2$withAudio = _ref2.withAudio, | ||
withAudio = _ref2$withAudio === void 0 ? 'enable' : _ref2$withAudio; | ||
encoderConfig = _ref2$encoderConfig === void 0 ? undefined : _ref2$encoderConfig, | ||
_ref2$optimizationMod = _ref2.optimizationMode, | ||
optimizationMode = _ref2$optimizationMod === void 0 ? undefined : _ref2$optimizationMod, | ||
_ref2$withAudio = _ref2.withAudio, | ||
withAudio = _ref2$withAudio === void 0 ? 'enable' : _ref2$withAudio; | ||
try { | ||
@@ -1653,8 +1468,7 @@ return Promise.resolve(VideoSDK.createScreenShareVideoTrack({ | ||
var _ref3$noiseConfig = _ref3.noiseConfig, | ||
noiseConfig = _ref3$noiseConfig === void 0 ? undefined : _ref3$noiseConfig, | ||
_ref3$encoderConfig = _ref3.encoderConfig, | ||
encoderConfig = _ref3$encoderConfig === void 0 ? undefined : _ref3$encoderConfig, | ||
_ref3$microphoneId = _ref3.microphoneId, | ||
microphoneId = _ref3$microphoneId === void 0 ? undefined : _ref3$microphoneId; | ||
noiseConfig = _ref3$noiseConfig === void 0 ? undefined : _ref3$noiseConfig, | ||
_ref3$encoderConfig = _ref3.encoderConfig, | ||
encoderConfig = _ref3$encoderConfig === void 0 ? undefined : _ref3$encoderConfig, | ||
_ref3$microphoneId = _ref3.microphoneId, | ||
microphoneId = _ref3$microphoneId === void 0 ? undefined : _ref3$microphoneId; | ||
try { | ||
@@ -1661,0 +1475,0 @@ return Promise.resolve(VideoSDK.createMicrophoneAudioTrack({ |
@@ -7,3 +7,52 @@ import MeetingProvider from "./meeting/MeetingProvider"; | ||
import useConnection from "./connection/useConnection"; | ||
export const Constants: any; | ||
export const Constants: { | ||
errors: { | ||
INVALID_TOKEN: number; | ||
INVALID_API_KEY: number; | ||
INVALID_PERMISSIONS: number; | ||
INVALID_MEETING_ID: number; | ||
INVALID_PARTICIPANT_ID: number; | ||
DUPLICATE_PARTICIPANT: number; | ||
ACCOUNT_DEACTIVATED: number; | ||
ACCOUNT_DISCONTINUED: number; | ||
START_RECORDING_FAILED: number; | ||
STOP_RECORDING_FAILED: number; | ||
START_LIVESTREAM_FAILED: number; | ||
STOP_LIVESTREAM_FAILED: number; | ||
INVALID_LIVESTREAM_CONFIG: number; | ||
START_HLS_FAILED: number; | ||
STOP_HLS_FAILED: number; | ||
RECORDING_FAILED: number; | ||
LIVESTREAM_FAILED: number; | ||
HLS_FAILED: number; | ||
ERROR_GET_VIDEO_MEDIA: number; | ||
ERROR_GET_AUDIO_MEDIA: number; | ||
ERROR_GET_DISPLAY_MEDIA: number; | ||
ERROR_GET_VIDEO_MEDIA_PERMISSION_DENIED: number; | ||
ERROR_GET_AUDIO_MEDIA_PERMISSION_DENIED: number; | ||
ERROR_GET_DISPLAY_MEDIA_PERMISSION_DENIED: number; | ||
}; | ||
recordingEvents: { | ||
RECORDING_STARTING: string; | ||
RECORDING_STARTED: string; | ||
RECORDING_STOPPING: string; | ||
RECORDING_STOPPED: string; | ||
}; | ||
livestreamEvents: { | ||
LIVESTREAM_STARTING: string; | ||
LIVESTREAM_STARTED: string; | ||
LIVESTREAM_STOPPING: string; | ||
LIVESTREAM_STOPPED: string; | ||
}; | ||
hlsEvents: { | ||
HLS_STARTING: string; | ||
HLS_STARTED: string; | ||
HLS_STOPPING: string; | ||
HLS_STOPPED: string; | ||
}; | ||
modes: { | ||
CONFERENCE: string; | ||
VIEWER: string; | ||
}; | ||
}; | ||
/** | ||
@@ -28,3 +77,3 @@ * @param {{ | ||
multiStream?: boolean; | ||
}): Promise<any>; | ||
}): Promise<MediaStream>; | ||
/** | ||
@@ -52,3 +101,3 @@ * @param {{ | ||
microphoneId?: string | undefined; | ||
}): Promise<any>; | ||
}): Promise<MediaStream>; | ||
/** | ||
@@ -66,4 +115,4 @@ * @param {{ | ||
withAudio?: "enable" | "disable"; | ||
}): Promise<any>; | ||
}): Promise<MediaStream>; | ||
export { MeetingProvider, useMeeting, useParticipant, usePubSub, MeetingConsumer, useConnection }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -43,18 +43,52 @@ export default useParticipant; | ||
* }) => Promise<void>; | ||
* getAudioStats: () => Promise<{ | ||
* bitrate: any; | ||
* score: any; | ||
* roundTripTime: any; | ||
* jitter: any; | ||
* totalPacketCount: any; | ||
* totalPacketsLost: any; | ||
* }>; | ||
* getVideoStats: () => Promise<{ | ||
* bitrate: any; | ||
* score: any; | ||
* roundTripTime: any; | ||
* jitter: any; | ||
* totalPacketCount: any; | ||
* totalPacketsLost: any; | ||
* }>; | ||
* getAudioStats: () => Promise<[{ | ||
* bitrate: number, | ||
* rtt: number, | ||
* network:String, | ||
* codec: String, | ||
* jitter: number, | ||
* limitation: Object, | ||
* totalPackets: number, | ||
* packetsLost: number, | ||
* concealmentEvents: number, | ||
* insertedSamplesForDecelaration: number, | ||
* removedSamplesForAccelaration: number, | ||
* size:Object | ||
* }]>; | ||
* getVideoStats: () => Promise<[{ | ||
* bitrate: number, | ||
* rtt: number, | ||
* network:String, | ||
* codec: String, | ||
* jitter: number, | ||
* limitation: Object, | ||
* totalPackets: number, | ||
* packetsLost: number, | ||
* concealmentEvents: number, | ||
* insertedSamplesForDecelaration: number, | ||
* removedSamplesForAccelaration: number, | ||
* size:Object, | ||
* currentSpatialLayer: number, | ||
* currentTemporalLayer: number, | ||
* preferredSpatialLayer: number, | ||
* preferredTemporalLayer: number | ||
* }]>; | ||
* getShareStats: () => Promise<[{ | ||
* bitrate: number, | ||
* rtt: number, | ||
* network:String, | ||
* codec: String, | ||
* jitter: number, | ||
* limitation: Object, | ||
* totalPackets: number, | ||
* packetsLost: number, | ||
* concealmentEvents: number, | ||
* insertedSamplesForDecelaration: number, | ||
* removedSamplesForAccelaration: number, | ||
* size:Object, | ||
* currentSpatialLayer: number, | ||
* currentTemporalLayer: number, | ||
* preferredSpatialLayer: number, | ||
* preferredTemporalLayer: number | ||
* }]>; | ||
*}} | ||
@@ -99,19 +133,59 @@ * | ||
}) => Promise<void>; | ||
getAudioStats: () => Promise<{ | ||
bitrate: any; | ||
score: any; | ||
roundTripTime: any; | ||
jitter: any; | ||
totalPacketCount: any; | ||
totalPacketsLost: any; | ||
}>; | ||
getVideoStats: () => Promise<{ | ||
bitrate: any; | ||
score: any; | ||
roundTripTime: any; | ||
jitter: any; | ||
totalPacketCount: any; | ||
totalPacketsLost: any; | ||
}>; | ||
getAudioStats: () => Promise<[ | ||
{ | ||
bitrate: number; | ||
rtt: number; | ||
network: string; | ||
codec: string; | ||
jitter: number; | ||
limitation: any; | ||
totalPackets: number; | ||
packetsLost: number; | ||
concealmentEvents: number; | ||
insertedSamplesForDecelaration: number; | ||
removedSamplesForAccelaration: number; | ||
size: any; | ||
} | ||
]>; | ||
getVideoStats: () => Promise<[ | ||
{ | ||
bitrate: number; | ||
rtt: number; | ||
network: string; | ||
codec: string; | ||
jitter: number; | ||
limitation: any; | ||
totalPackets: number; | ||
packetsLost: number; | ||
concealmentEvents: number; | ||
insertedSamplesForDecelaration: number; | ||
removedSamplesForAccelaration: number; | ||
size: any; | ||
currentSpatialLayer: number; | ||
currentTemporalLayer: number; | ||
preferredSpatialLayer: number; | ||
preferredTemporalLayer: number; | ||
} | ||
]>; | ||
getShareStats: () => Promise<[ | ||
{ | ||
bitrate: number; | ||
rtt: number; | ||
network: string; | ||
codec: string; | ||
jitter: number; | ||
limitation: any; | ||
totalPackets: number; | ||
packetsLost: number; | ||
concealmentEvents: number; | ||
insertedSamplesForDecelaration: number; | ||
removedSamplesForAccelaration: number; | ||
size: any; | ||
currentSpatialLayer: number; | ||
currentTemporalLayer: number; | ||
preferredSpatialLayer: number; | ||
preferredTemporalLayer: number; | ||
} | ||
]>; | ||
}; | ||
//# sourceMappingURL=useParticipant.d.ts.map |
{ | ||
"name": "@videosdk.live/react-sdk", | ||
"version": "0.1.53", | ||
"version": "0.1.54", | ||
"license": "ISC", | ||
@@ -8,2 +8,3 @@ "main": "dist/index.js", | ||
"source": "src/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
@@ -78,2 +79,2 @@ "build": "npx tsc && microbundle-crl --no-compress --format modern,cjs", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
367806
3376
1