Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(react-native-sdk): add ENDPOINT_MESSAGE_RECEIVED to rnsdk events (#14889)
Calinteodor782d46b4a69d
diff --git a/react-native-sdk/index.tsx b/react-native-sdk/index.tsxindex 447008aa45..cf5585dc55 100644--- a/react-native-sdk/index.tsx+++ b/react-native-sdk/index.tsx@@ -30,6 +30,7 @@ interface IEventListeners {onConferenceLeft?: Function;onConferenceWillJoin?: Function;onEnterPictureInPicture?: Function;+ onEndpointMessageReceived?: Function;onParticipantJoined?: Function;onParticipantLeft?: ({ id }: { id: string }) => void;onReadyToClose?: Function;@@ -133,6 +134,7 @@ export const JitsiMeeting = forwardRef<JitsiRefProps, IAppProps>((props, ref) =>onConferenceWillJoin: eventListeners?.onConferenceWillJoin,onConferenceLeft: eventListeners?.onConferenceLeft,onEnterPictureInPicture: eventListeners?.onEnterPictureInPicture,+ onEndpointMessageReceived: eventListeners?.onEndpointMessageReceived,onParticipantJoined: eventListeners?.onParticipantJoined,onParticipantLeft: eventListeners?.onParticipantLeft,onReadyToClose: eventListeners?.onReadyToClosediff --git a/react-native-sdk/update_dependencies.js b/react-native-sdk/update_dependencies.jsindex d30616c1f5..970ceff0d9 100644--- a/react-native-sdk/update_dependencies.js+++ b/react-native-sdk/update_dependencies.js@@ -21,11 +21,6 @@ function updateDependencies() {for (const key in RNSDKpackageJSON.peerDependencies) {if (!packageJSON.dependencies.hasOwnProperty(key)) {-- if (packageJSON.devDependencies.hasOwnProperty('@react-native/metro-config')) {- continue;- }-packageJSON.dependencies[key] = RNSDKpackageJSON.peerDependencies[key];updated = true;}diff --git a/react/features/mobile/react-native-sdk/middleware.js b/react/features/mobile/react-native-sdk/middleware.jsindex ab742892da..a8922e7302 100644--- a/react/features/mobile/react-native-sdk/middleware.js+++ b/react/features/mobile/react-native-sdk/middleware.js@@ -4,7 +4,8 @@ import {CONFERENCE_FOCUSED,CONFERENCE_JOINED,CONFERENCE_LEFT,- CONFERENCE_WILL_JOIN+ CONFERENCE_WILL_JOIN,+ ENDPOINT_MESSAGE_RECEIVED} from '../../base/conference/actionTypes';import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../../base/media/actionTypes';import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../../base/participants/actionTypes';@@ -29,34 +30,43 @@ const externalAPIEnabled = isExternalAPIAvailable();switch (type) {case SET_AUDIO_MUTED:- rnSdkHandlers?.onAudioMutedChanged && rnSdkHandlers?.onAudioMutedChanged(action.muted);+ rnSdkHandlers?.onAudioMutedChanged?.(action.muted);break;case SET_VIDEO_MUTED:- rnSdkHandlers?.onVideoMutedChanged && rnSdkHandlers?.onVideoMutedChanged(Boolean(action.muted));+ rnSdkHandlers?.onVideoMutedChanged?.(Boolean(action.muted));break;case CONFERENCE_BLURRED:- rnSdkHandlers?.onConferenceBlurred && rnSdkHandlers?.onConferenceBlurred();+ rnSdkHandlers?.onConferenceBlurred?.();break;case CONFERENCE_FOCUSED:- rnSdkHandlers?.onConferenceFocused && rnSdkHandlers?.onConferenceFocused();+ rnSdkHandlers?.onConferenceFocused?.();break;case CONFERENCE_JOINED:- rnSdkHandlers?.onConferenceJoined && rnSdkHandlers?.onConferenceJoined();+ rnSdkHandlers?.onConferenceJoined?.();break;case CONFERENCE_LEFT:// Props are torn down at this point, perhaps need to leave this one outbreak;case CONFERENCE_WILL_JOIN:- rnSdkHandlers?.onConferenceWillJoin && rnSdkHandlers?.onConferenceWillJoin();+ rnSdkHandlers?.onConferenceWillJoin?.();break;case ENTER_PICTURE_IN_PICTURE:- rnSdkHandlers?.onEnterPictureInPicture && rnSdkHandlers?.onEnterPictureInPicture();+ rnSdkHandlers?.onEnterPictureInPicture?.();break;+ case ENDPOINT_MESSAGE_RECEIVED: {+ const { data, participant } = action;++ rnSdkHandlers?.onEndpointMessageReceived?.({+ data,+ participant+ });+ break;+ }case PARTICIPANT_JOINED: {const { participant } = action;const participantInfo = participantToParticipantInfo(participant);- rnSdkHandlers?.onParticipantJoined && rnSdkHandlers?.onParticipantJoined(participantInfo);+ rnSdkHandlers?.onParticipantJoined?.(participantInfo);break;}case PARTICIPANT_LEFT: {@@ -64,11 +74,11 @@ const externalAPIEnabled = isExternalAPIAvailable();const { id } = participant ?? {};- rnSdkHandlers?.onParticipantLeft && rnSdkHandlers?.onParticipantLeft({ id });+ rnSdkHandlers?.onParticipantLeft?.({ id });break;}case READY_TO_CLOSE:- rnSdkHandlers?.onReadyToClose && rnSdkHandlers?.onReadyToClose();+ rnSdkHandlers?.onReadyToClose?.();break;}