mediasfu-shared 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +103 -222
- package/dist/index.cjs +7634 -2180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4203 -273
- package/dist/index.js +7663 -2209
- package/dist/index.js.map +1 -1
- package/package.json +96 -78
- package/src/ProducerClient/producerClientEmits/joinRoomClient.ts +57 -0
- package/src/ProducerClient/producerClientEmits/updateRoomParametersClient.ts +401 -0
- package/src/consumers/addVideosGrid.ts +3 -2
- package/src/consumers/changeVids.ts +111 -41
- package/src/consumers/checkPermission.ts +35 -1
- package/src/consumers/connectIps.ts +3 -1
- package/src/consumers/connectLocalIps.ts +3 -1
- package/src/consumers/connectRecvTransport.ts +96 -1
- package/src/consumers/consumerResume.ts +2 -2
- package/src/consumers/dispStreams.ts +83 -37
- package/src/consumers/frameworkConsumerContract.ts +6 -0
- package/src/consumers/generatePageContent.ts +24 -10
- package/src/consumers/getPipedProducersAlt.ts +112 -16
- package/src/consumers/gridLayout/addVideosGrid.engine.ts +42 -0
- package/src/consumers/gridLayout/prepopulateUserMedia.engine.ts +444 -0
- package/src/consumers/mixStreams.ts +45 -14
- package/src/consumers/onScreenChanges.ts +25 -10
- package/src/consumers/prepopulateUserMedia.ts +3 -2
- package/src/consumers/processConsumerTransports.ts +68 -23
- package/src/consumers/processConsumerTransportsAudio.ts +146 -17
- package/src/consumers/reUpdateInter.ts +61 -21
- package/src/consumers/readjust.ts +30 -14
- package/src/consumers/reorderStreams.ts +76 -42
- package/src/consumers/resumePauseAudioStreams.ts +66 -17
- package/src/consumers/resumePauseStreams.ts +53 -10
- package/src/consumers/socketReceiveMethods/joinConsumeRoom.ts +8 -0
- package/src/consumers/socketReceiveMethods/newPipeProducer.ts +114 -0
- package/src/consumers/socketReceiveMethods/producerClosed.ts +13 -0
- package/src/consumers/streamSuccessScreen.ts +2 -2
- package/src/consumers/streamSuccessVideo.ts +5 -0
- package/src/consumers/translationConsumerSwitch.ts +321 -0
- package/src/index.ts +85 -1
- package/src/methods/coHostMethods/modifyCoHostSettings.ts +9 -9
- package/src/methods/displaySettings/modifyDisplaySettings.ts +5 -0
- package/src/methods/index.ts +66 -0
- package/src/methods/message/sendMessage.ts +12 -29
- package/src/methods/panelists/focusPanelists.ts +83 -0
- package/src/methods/panelists/index.ts +3 -0
- package/src/methods/panelists/launchPanelists.ts +13 -0
- package/src/methods/panelists/updatePanelists.ts +135 -0
- package/src/methods/permissions/index.ts +3 -0
- package/src/methods/permissions/launchPermissions.ts +13 -0
- package/src/methods/permissions/updateParticipantPermission.ts +127 -0
- package/src/methods/permissions/updatePermissionConfig.ts +52 -0
- package/src/methods/polls/pollUpdated.ts +88 -0
- package/src/methods/recording/confirmRecording.ts +15 -12
- package/src/methods/recording/recordResumeTimer.ts +2 -2
- package/src/methods/recording/recordStartTimer.ts +2 -2
- package/src/methods/recording/timeLeftRecording.ts +25 -0
- package/src/methods/requests/hostRequestResponse.ts +158 -0
- package/src/methods/settings/modifySettings.ts +17 -17
- package/src/methods/socketReceive/allMembers.ts +450 -0
- package/src/methods/socketReceive/allMembersRest.ts +480 -0
- package/src/methods/socketReceive/allWaitingRoomMembers.ts +35 -0
- package/src/methods/socketReceive/banParticipant.ts +73 -0
- package/src/methods/socketReceive/controlMediaHost.ts +280 -0
- package/src/methods/socketReceive/disconnect.ts +40 -0
- package/src/methods/socketReceive/disconnectUserSelf.ts +56 -0
- package/src/methods/socketReceive/getDomains.ts +112 -0
- package/src/methods/socketReceive/meetingEnded.ts +49 -0
- package/src/methods/socketReceive/meetingStillThere.ts +26 -0
- package/src/methods/socketReceive/panelistReceiveMethods.ts +195 -0
- package/src/methods/socketReceive/participantRequested.ts +48 -0
- package/src/methods/socketReceive/permissionReceiveMethods.ts +59 -0
- package/src/methods/socketReceive/personJoined.ts +35 -0
- package/src/methods/socketReceive/producerMediaClosed.ts +223 -0
- package/src/methods/socketReceive/producerMediaPaused.ts +267 -0
- package/src/methods/socketReceive/producerMediaResumed.ts +157 -0
- package/src/methods/socketReceive/reInitiateRecording.ts +53 -0
- package/src/methods/socketReceive/receiveMessage.ts +117 -0
- package/src/methods/socketReceive/recordingNotice.ts +286 -0
- package/src/methods/socketReceive/roomRecordParams.ts +122 -0
- package/src/methods/socketReceive/screenProducerId.ts +61 -0
- package/src/methods/socketReceive/startRecords.ts +46 -0
- package/src/methods/socketReceive/stoppedRecording.ts +44 -0
- package/src/methods/socketReceive/translationReceiveMethods.ts +581 -0
- package/src/methods/socketReceive/updateConsumingDomains.ts +128 -0
- package/src/methods/socketReceive/updateMediaSettings.ts +45 -0
- package/src/methods/socketReceive/updatedCoHost.ts +75 -0
- package/src/methods/socketReceive/userWaiting.ts +45 -0
- package/src/methods/stream/clickAudio.ts +380 -0
- package/src/methods/stream/clickChat.ts +36 -0
- package/src/methods/stream/clickScreenShare.ts +173 -0
- package/src/methods/stream/clickVideo.ts +28 -6
- package/src/methods/stream/index.ts +1 -0
- package/src/methods/utils/SoundPlayer.ts +31 -0
- package/src/methods/utils/checkLimitsAndMakeRequest.ts +156 -2
- package/src/methods/utils/createResponseJoinRoom.ts +47 -0
- package/src/methods/utils/createRoomOnMediaSFU.ts +160 -0
- package/src/methods/utils/formatNumber.ts +42 -0
- package/src/methods/utils/generateRandomMessages.ts +70 -0
- package/src/methods/utils/generateRandomParticipants.ts +100 -0
- package/src/methods/utils/generateRandomPolls.ts +43 -0
- package/src/methods/utils/generateRandomRequestList.ts +51 -0
- package/src/methods/utils/generateRandomWaitingRoomList.ts +17 -0
- package/src/methods/utils/getModalPosition.ts +23 -0
- package/src/methods/utils/getOverlayPosition.ts +37 -0
- package/src/methods/utils/initialValuesState.ts +405 -0
- package/src/methods/utils/joinRoomOnMediaSFU.ts +124 -0
- package/src/methods/utils/liveSubtitle.ts +107 -0
- package/src/methods/utils/meetingTimeRemaining.ts +33 -0
- package/src/methods/utils/meetingTimer/startMeetingProgressTimer.ts +72 -0
- package/src/methods/utils/producer/aParams.ts +10 -0
- package/src/methods/utils/producer/hParams.ts +26 -0
- package/src/methods/utils/producer/screenParams.ts +13 -0
- package/src/methods/utils/producer/vParams.ts +26 -0
- package/src/methods/utils/producer/videoCaptureConstraints.ts +65 -0
- package/src/methods/utils/resolveMediaSFURoomApi.ts +28 -0
- package/src/methods/utils/sleep.ts +24 -0
- package/src/methods/utils/translationLanguages.ts +308 -0
- package/src/methods/utils/webrtc.ts +44 -0
- package/src/methods/welcome/handleWelcomeRequest.ts +11 -2
- package/src/methods/welcome/index.ts +5 -1
- package/src/methods/whiteboard/captureCanvasStream.ts +128 -0
- package/src/producers/producerEmits/joinConRoom.ts +2 -2
- package/src/producers/producerEmits/joinLocalRoom.ts +240 -0
- package/src/producers/producerEmits/joinRoom.ts +129 -0
- package/src/types/shared-base-types.ts +14 -3
- package/src/types/types.ts +255 -0
package/src/index.ts
CHANGED
|
@@ -11,11 +11,14 @@ export * from './consumers/checkScreenShare';
|
|
|
11
11
|
export * from './consumers/closeAndResize';
|
|
12
12
|
export * from './consumers/compareActiveNames';
|
|
13
13
|
export * from './consumers/compareScreenStates';
|
|
14
|
+
export * from './consumers/gridLayout/addVideosGrid.engine';
|
|
15
|
+
export * from './consumers/gridLayout/prepopulateUserMedia.engine';
|
|
14
16
|
export * from './consumers/connectIps';
|
|
15
17
|
export * from './consumers/connectLocalIps';
|
|
16
18
|
export * from './consumers/connectRecvTransport';
|
|
17
19
|
export * from './consumers/connectSendTransport';
|
|
18
20
|
export * from './consumers/connectSendTransportAudio';
|
|
21
|
+
export * from './consumers/consumerResume';
|
|
19
22
|
export * from './consumers/connectSendTransportScreen';
|
|
20
23
|
export * from './consumers/connectSendTransportVideo';
|
|
21
24
|
export * from './consumers/controlMedia';
|
|
@@ -56,6 +59,7 @@ export * from './consumers/streamSuccessVideo';
|
|
|
56
59
|
export * from './consumers/switchUserAudio';
|
|
57
60
|
export * from './consumers/switchUserVideo';
|
|
58
61
|
export * from './consumers/switchUserVideoAlt';
|
|
62
|
+
export * from './consumers/translationConsumerSwitch';
|
|
59
63
|
export * from './consumers/trigger';
|
|
60
64
|
export * from './consumers/updateMiniCardsGrid';
|
|
61
65
|
export * from './consumers/updateParticipantAudioDecibels';
|
|
@@ -79,10 +83,17 @@ export * from './methods/participants/launchParticipants';
|
|
|
79
83
|
export * from './methods/participants/messageParticipants';
|
|
80
84
|
export * from './methods/participants/muteParticipants';
|
|
81
85
|
export * from './methods/participants/removeParticipants';
|
|
86
|
+
export * from './methods/panelists/launchPanelists';
|
|
87
|
+
export * from './methods/panelists/updatePanelists';
|
|
88
|
+
export * from './methods/panelists/focusPanelists';
|
|
89
|
+
export * from './methods/permissions/launchPermissions';
|
|
90
|
+
export * from './methods/permissions/updateParticipantPermission';
|
|
91
|
+
export * from './methods/permissions/updatePermissionConfig';
|
|
82
92
|
export * from './methods/polls/handleCreatePoll';
|
|
83
93
|
export * from './methods/polls/handleEndPoll';
|
|
84
94
|
export * from './methods/polls/handleVotePoll';
|
|
85
95
|
export * from './methods/polls/launchPoll';
|
|
96
|
+
export * from './methods/polls/pollUpdated';
|
|
86
97
|
export * from './methods/prejoin/handleCreateRoom';
|
|
87
98
|
export * from './methods/prejoin/handleJoinRoom';
|
|
88
99
|
export * from './methods/recording/checkPauseState';
|
|
@@ -95,24 +106,97 @@ export * from './methods/recording/recordStartTimer';
|
|
|
95
106
|
export * from './methods/recording/recordUpdateTimer';
|
|
96
107
|
export * from './methods/recording/startRecording';
|
|
97
108
|
export * from './methods/recording/stopRecording';
|
|
109
|
+
export * from './methods/recording/timeLeftRecording';
|
|
98
110
|
export * from './methods/recording/updateRecording';
|
|
99
111
|
export * from './methods/requests/launchRequests';
|
|
112
|
+
export * from './methods/requests/hostRequestResponse';
|
|
100
113
|
export * from './methods/requests/respondToRequests';
|
|
101
114
|
export * from './methods/settings/launchSettings';
|
|
102
115
|
export * from './methods/settings/modifySettings';
|
|
103
116
|
export * from './methods/stream/switchAudio';
|
|
104
117
|
export * from './methods/stream/switchVideo';
|
|
105
118
|
export * from './methods/stream/switchVideoAlt';
|
|
119
|
+
export * from './methods/stream/clickAudio';
|
|
120
|
+
export * from './methods/stream/clickChat';
|
|
121
|
+
export * from './methods/stream/clickScreenShare';
|
|
122
|
+
export * from './methods/utils/liveSubtitle';
|
|
123
|
+
export * from './methods/utils/translationLanguages';
|
|
124
|
+
export * from './methods/utils/SoundPlayer';
|
|
125
|
+
export * from './methods/utils/getOverlayPosition';
|
|
126
|
+
export * from './methods/utils/getModalPosition';
|
|
127
|
+
export * from './methods/utils/sleep';
|
|
128
|
+
export * from './methods/utils/formatNumber';
|
|
129
|
+
export * from './methods/utils/generateRandomMessages';
|
|
130
|
+
export * from './methods/utils/generateRandomParticipants';
|
|
131
|
+
export * from './methods/utils/generateRandomPolls';
|
|
132
|
+
export * from './methods/utils/generateRandomRequestList';
|
|
133
|
+
export * from './methods/utils/generateRandomWaitingRoomList';
|
|
134
|
+
export * from './methods/utils/initialValuesState';
|
|
135
|
+
export * from './methods/utils/webrtc';
|
|
136
|
+
export * from './methods/utils/checkLimitsAndMakeRequest';
|
|
137
|
+
export * from './methods/utils/createResponseJoinRoom';
|
|
138
|
+
export * from './methods/utils/joinRoomOnMediaSFU';
|
|
139
|
+
export * from './methods/utils/createRoomOnMediaSFU';
|
|
140
|
+
export * from './methods/utils/meetingTimer/startMeetingProgressTimer';
|
|
141
|
+
export * from './methods/utils/meetingTimeRemaining';
|
|
142
|
+
export * from './methods/utils/producer/aParams';
|
|
143
|
+
export * from './methods/utils/producer/hParams';
|
|
144
|
+
export * from './methods/utils/producer/vParams';
|
|
145
|
+
export * from './methods/utils/producer/screenParams';
|
|
146
|
+
export * from './methods/utils/producer/videoCaptureConstraints';
|
|
147
|
+
export * from './methods/utils/validateAlphanumeric';
|
|
148
|
+
export * from './methods/socketReceive/allWaitingRoomMembers';
|
|
149
|
+
export * from './methods/socketReceive/allMembers';
|
|
150
|
+
export * from './methods/socketReceive/allMembersRest';
|
|
151
|
+
export * from './methods/socketReceive/banParticipant';
|
|
152
|
+
export * from './methods/socketReceive/controlMediaHost';
|
|
153
|
+
export * from './methods/socketReceive/disconnect';
|
|
154
|
+
export * from './methods/socketReceive/disconnectUserSelf';
|
|
155
|
+
export * from './methods/socketReceive/getDomains';
|
|
156
|
+
export * from './methods/socketReceive/meetingEnded';
|
|
157
|
+
export * from './methods/socketReceive/meetingStillThere';
|
|
158
|
+
export * from './methods/socketReceive/panelistReceiveMethods';
|
|
159
|
+
export * from './methods/socketReceive/participantRequested';
|
|
160
|
+
export * from './methods/socketReceive/permissionReceiveMethods';
|
|
161
|
+
export * from './methods/socketReceive/personJoined';
|
|
162
|
+
export * from './methods/socketReceive/producerMediaClosed';
|
|
163
|
+
export * from './methods/socketReceive/producerMediaPaused';
|
|
164
|
+
export * from './methods/socketReceive/producerMediaResumed';
|
|
165
|
+
export * from './methods/socketReceive/receiveMessage';
|
|
166
|
+
export * from './methods/socketReceive/recordingNotice';
|
|
167
|
+
export * from './methods/socketReceive/reInitiateRecording';
|
|
168
|
+
export * from './methods/socketReceive/roomRecordParams';
|
|
169
|
+
export * from './methods/socketReceive/screenProducerId';
|
|
170
|
+
export * from './methods/socketReceive/startRecords';
|
|
171
|
+
export * from './methods/socketReceive/stoppedRecording';
|
|
172
|
+
export * from './methods/socketReceive/translationReceiveMethods';
|
|
173
|
+
export * from './methods/socketReceive/updateMediaSettings';
|
|
174
|
+
export * from './methods/socketReceive/updateConsumingDomains';
|
|
175
|
+
export * from './methods/socketReceive/updatedCoHost';
|
|
176
|
+
export * from './methods/socketReceive/userWaiting';
|
|
106
177
|
export * from './methods/waiting/launchWaiting';
|
|
107
178
|
export * from './methods/waiting/respondToWaiting';
|
|
108
|
-
export
|
|
179
|
+
export {
|
|
180
|
+
handleWelcomeRequest,
|
|
181
|
+
validateAlphanumeric as validateWelcomeAlphanumeric,
|
|
182
|
+
validateWelcomeInputs,
|
|
183
|
+
} from './methods/welcome/handleWelcomeRequest';
|
|
184
|
+
export type {
|
|
185
|
+
HandleWelcomeRequestOptions,
|
|
186
|
+
ValidateWelcomeInputsOptions,
|
|
187
|
+
} from './methods/welcome/handleWelcomeRequest';
|
|
109
188
|
export * from './methods/whiteboard/handleStartWhiteboard';
|
|
110
189
|
export * from './methods/whiteboard/handleStopWhiteboard';
|
|
111
190
|
export * from './methods/whiteboard/launchConfigureWhiteboard';
|
|
191
|
+
export * from './methods/whiteboard/captureCanvasStream';
|
|
112
192
|
// ProducerClient exports
|
|
113
193
|
export * from './ProducerClient/producerClientEmits/createDeviceClient';
|
|
194
|
+
export * from './ProducerClient/producerClientEmits/joinRoomClient';
|
|
195
|
+
export * from './ProducerClient/producerClientEmits/updateRoomParametersClient';
|
|
114
196
|
// Producers exports
|
|
115
197
|
export * from './producers/producerEmits/joinConRoom';
|
|
198
|
+
export * from './producers/producerEmits/joinLocalRoom';
|
|
199
|
+
export * from './producers/producerEmits/joinRoom';
|
|
116
200
|
// Socket exports
|
|
117
201
|
export * from './sockets/SocketManager';
|
|
118
202
|
// Stream method exports (clickVideo)
|
|
@@ -51,7 +51,7 @@ export type ModifyCoHostSettingsType = (options: ModifyCoHostSettingsOptions) =>
|
|
|
51
51
|
*/
|
|
52
52
|
export const modifyCoHostSettings = async ({
|
|
53
53
|
roomName,
|
|
54
|
-
showAlert,
|
|
54
|
+
// showAlert,
|
|
55
55
|
selectedParticipant,
|
|
56
56
|
coHost,
|
|
57
57
|
coHostResponsibility,
|
|
@@ -61,15 +61,15 @@ export const modifyCoHostSettings = async ({
|
|
|
61
61
|
socket,
|
|
62
62
|
}: ModifyCoHostSettingsOptions): Promise<void> => {
|
|
63
63
|
// Check if the chat room is in demo mode
|
|
64
|
-
if (roomName.toLowerCase().startsWith('d')) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
// if (roomName.toLowerCase().startsWith('d')) {
|
|
65
|
+
// showAlert?.({
|
|
66
|
+
// message: 'You cannot add co-host in demo mode.',
|
|
67
|
+
// type: 'danger',
|
|
68
|
+
// duration: 3000,
|
|
69
|
+
// });
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
}
|
|
71
|
+
// return;
|
|
72
|
+
// }
|
|
73
73
|
|
|
74
74
|
let newCoHost = coHost;
|
|
75
75
|
|
|
@@ -6,6 +6,7 @@ export interface ModifyDisplaySettingsParameters extends OnScreenChangesParamete
|
|
|
6
6
|
meetingDisplayType: string
|
|
7
7
|
autoWave: boolean
|
|
8
8
|
forceFullDisplay: boolean
|
|
9
|
+
showSubtitlesOnCards?: boolean
|
|
9
10
|
meetingVideoOptimized: boolean
|
|
10
11
|
islevel: string
|
|
11
12
|
recordStarted: boolean
|
|
@@ -19,6 +20,7 @@ export interface ModifyDisplaySettingsParameters extends OnScreenChangesParamete
|
|
|
19
20
|
updateMeetingDisplayType: (displayType: string) => void
|
|
20
21
|
updateAutoWave: (autoWave: boolean) => void
|
|
21
22
|
updateForceFullDisplay: (forceFullDisplay: boolean) => void
|
|
23
|
+
updateShowSubtitlesOnCards?: (showSubtitlesOnCards: boolean) => void
|
|
22
24
|
updateMeetingVideoOptimized: (optimized: boolean) => void
|
|
23
25
|
updatePrevForceFullDisplay: (forceFullDisplay: boolean) => void
|
|
24
26
|
updatePrevMeetingDisplayType: (displayType: string) => void
|
|
@@ -121,6 +123,7 @@ export const modifyDisplaySettings = async ({
|
|
|
121
123
|
meetingDisplayType,
|
|
122
124
|
autoWave,
|
|
123
125
|
forceFullDisplay,
|
|
126
|
+
showSubtitlesOnCards = true,
|
|
124
127
|
meetingVideoOptimized,
|
|
125
128
|
islevel,
|
|
126
129
|
recordStarted,
|
|
@@ -134,6 +137,7 @@ export const modifyDisplaySettings = async ({
|
|
|
134
137
|
updateMeetingDisplayType,
|
|
135
138
|
updateAutoWave,
|
|
136
139
|
updateForceFullDisplay,
|
|
140
|
+
updateShowSubtitlesOnCards,
|
|
137
141
|
updateMeetingVideoOptimized,
|
|
138
142
|
updatePrevForceFullDisplay,
|
|
139
143
|
updatePrevMeetingDisplayType,
|
|
@@ -148,6 +152,7 @@ export const modifyDisplaySettings = async ({
|
|
|
148
152
|
// Update previous states
|
|
149
153
|
updateAutoWave(autoWave)
|
|
150
154
|
updateForceFullDisplay(forceFullDisplay)
|
|
155
|
+
updateShowSubtitlesOnCards?.(showSubtitlesOnCards)
|
|
151
156
|
|
|
152
157
|
if (
|
|
153
158
|
islevel === '2' &&
|
package/src/methods/index.ts
CHANGED
|
@@ -3,3 +3,69 @@
|
|
|
3
3
|
export * from './prejoin';
|
|
4
4
|
// Welcome methods
|
|
5
5
|
export * from './welcome';
|
|
6
|
+
// Panelists methods
|
|
7
|
+
export * from './panelists';
|
|
8
|
+
// Permissions methods
|
|
9
|
+
export * from './permissions';
|
|
10
|
+
// Shared utility methods
|
|
11
|
+
export * from './utils/liveSubtitle';
|
|
12
|
+
export * from './utils/translationLanguages';
|
|
13
|
+
export * from './utils/SoundPlayer';
|
|
14
|
+
export * from './utils/getOverlayPosition';
|
|
15
|
+
export * from './utils/sleep';
|
|
16
|
+
export * from './utils/formatNumber';
|
|
17
|
+
export * from './utils/generateRandomMessages';
|
|
18
|
+
export * from './utils/generateRandomParticipants';
|
|
19
|
+
export * from './utils/generateRandomPolls';
|
|
20
|
+
export * from './utils/generateRandomRequestList';
|
|
21
|
+
export * from './utils/generateRandomWaitingRoomList';
|
|
22
|
+
export * from './utils/initialValuesState';
|
|
23
|
+
export * from './utils/webrtc';
|
|
24
|
+
export * from './utils/checkLimitsAndMakeRequest';
|
|
25
|
+
export * from './utils/createResponseJoinRoom';
|
|
26
|
+
export * from './utils/joinRoomOnMediaSFU';
|
|
27
|
+
export * from './utils/createRoomOnMediaSFU';
|
|
28
|
+
export * from './utils/meetingTimer/startMeetingProgressTimer';
|
|
29
|
+
export * from './utils/meetingTimeRemaining';
|
|
30
|
+
export * from './utils/producer/aParams';
|
|
31
|
+
export * from './utils/producer/hParams';
|
|
32
|
+
export * from './utils/producer/vParams';
|
|
33
|
+
export * from './utils/producer/screenParams';
|
|
34
|
+
export * from './utils/producer/videoCaptureConstraints';
|
|
35
|
+
export * from './utils/validateAlphanumeric';
|
|
36
|
+
export * from './polls/pollUpdated';
|
|
37
|
+
export * from './requests/hostRequestResponse';
|
|
38
|
+
export * from './stream/clickAudio';
|
|
39
|
+
export * from './stream/clickChat';
|
|
40
|
+
export * from './stream/clickScreenShare';
|
|
41
|
+
export * from './whiteboard/captureCanvasStream';
|
|
42
|
+
export * from './recording/timeLeftRecording';
|
|
43
|
+
export * from './socketReceive/allWaitingRoomMembers';
|
|
44
|
+
export * from './socketReceive/allMembers';
|
|
45
|
+
export * from './socketReceive/allMembersRest';
|
|
46
|
+
export * from './socketReceive/banParticipant';
|
|
47
|
+
export * from './socketReceive/controlMediaHost';
|
|
48
|
+
export * from './socketReceive/disconnect';
|
|
49
|
+
export * from './socketReceive/disconnectUserSelf';
|
|
50
|
+
export * from './socketReceive/getDomains';
|
|
51
|
+
export * from './socketReceive/meetingEnded';
|
|
52
|
+
export * from './socketReceive/meetingStillThere';
|
|
53
|
+
export * from './socketReceive/panelistReceiveMethods';
|
|
54
|
+
export * from './socketReceive/participantRequested';
|
|
55
|
+
export * from './socketReceive/permissionReceiveMethods';
|
|
56
|
+
export * from './socketReceive/personJoined';
|
|
57
|
+
export * from './socketReceive/producerMediaClosed';
|
|
58
|
+
export * from './socketReceive/producerMediaPaused';
|
|
59
|
+
export * from './socketReceive/producerMediaResumed';
|
|
60
|
+
export * from './socketReceive/receiveMessage';
|
|
61
|
+
export * from './socketReceive/recordingNotice';
|
|
62
|
+
export * from './socketReceive/reInitiateRecording';
|
|
63
|
+
export * from './socketReceive/roomRecordParams';
|
|
64
|
+
export * from './socketReceive/screenProducerId';
|
|
65
|
+
export * from './socketReceive/startRecords';
|
|
66
|
+
export * from './socketReceive/stoppedRecording';
|
|
67
|
+
export * from './socketReceive/translationReceiveMethods';
|
|
68
|
+
export * from './socketReceive/updateMediaSettings';
|
|
69
|
+
export * from './socketReceive/updateConsumingDomains';
|
|
70
|
+
export * from './socketReceive/updatedCoHost';
|
|
71
|
+
export * from './socketReceive/userWaiting';
|
|
@@ -77,7 +77,6 @@ export const sendMessage = async ({
|
|
|
77
77
|
member,
|
|
78
78
|
sender,
|
|
79
79
|
islevel,
|
|
80
|
-
eventType,
|
|
81
80
|
showAlert,
|
|
82
81
|
coHostResponsibility,
|
|
83
82
|
coHost,
|
|
@@ -87,34 +86,18 @@ export const sendMessage = async ({
|
|
|
87
86
|
}: SendMessageOptions): Promise<void> => {
|
|
88
87
|
let chatValue = false;
|
|
89
88
|
|
|
90
|
-
// Check
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
showAlert?.({
|
|
103
|
-
message: "You have reached the maximum number of messages",
|
|
104
|
-
type: "danger",
|
|
105
|
-
duration: 3000,
|
|
106
|
-
});
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
if (messagesLength >= 100000) {
|
|
111
|
-
showAlert?.({
|
|
112
|
-
message: "You have reached the maximum number of messages",
|
|
113
|
-
type: "danger",
|
|
114
|
-
duration: 3000,
|
|
115
|
-
});
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
89
|
+
// Check message count limit based on room type prefix
|
|
90
|
+
if (
|
|
91
|
+
(messagesLength > 100 && roomName.startsWith("d")) ||
|
|
92
|
+
(messagesLength > 500 && roomName.startsWith("s")) ||
|
|
93
|
+
(messagesLength > 100000 && roomName.startsWith("p"))
|
|
94
|
+
) {
|
|
95
|
+
showAlert?.({
|
|
96
|
+
message: "You have reached the maximum number of messages allowed.",
|
|
97
|
+
type: "danger",
|
|
98
|
+
duration: 3000,
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
118
101
|
}
|
|
119
102
|
|
|
120
103
|
// Check if message is valid
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Socket } from 'socket.io-client';
|
|
2
|
+
import type { ShowAlert } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
export interface FocusPanelistsOptions {
|
|
5
|
+
socket: Socket;
|
|
6
|
+
roomName: string;
|
|
7
|
+
member: string;
|
|
8
|
+
islevel: string;
|
|
9
|
+
focusEnabled: boolean;
|
|
10
|
+
muteOthersMic?: boolean;
|
|
11
|
+
muteOthersCamera?: boolean;
|
|
12
|
+
showAlert?: ShowAlert;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface UnfocusPanelistsOptions {
|
|
16
|
+
socket: Socket;
|
|
17
|
+
roomName: string;
|
|
18
|
+
member: string;
|
|
19
|
+
islevel: string;
|
|
20
|
+
showAlert?: ShowAlert;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type FocusPanelistsType = (options: FocusPanelistsOptions) => Promise<void>;
|
|
24
|
+
export type UnfocusPanelistsType = (options: UnfocusPanelistsOptions) => Promise<void>;
|
|
25
|
+
|
|
26
|
+
export const focusPanelists = async ({
|
|
27
|
+
socket,
|
|
28
|
+
roomName,
|
|
29
|
+
member: _member,
|
|
30
|
+
islevel,
|
|
31
|
+
focusEnabled,
|
|
32
|
+
muteOthersMic = false,
|
|
33
|
+
muteOthersCamera = false,
|
|
34
|
+
showAlert,
|
|
35
|
+
}: FocusPanelistsOptions): Promise<void> => {
|
|
36
|
+
if (islevel !== '2') {
|
|
37
|
+
showAlert?.({ message: 'Only the host can focus panelists', type: 'danger', duration: 3000 });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
socket.emit(
|
|
42
|
+
'focusPanelists',
|
|
43
|
+
{
|
|
44
|
+
roomName,
|
|
45
|
+
focusEnabled,
|
|
46
|
+
muteOthersMic,
|
|
47
|
+
muteOthersCamera,
|
|
48
|
+
},
|
|
49
|
+
(response: { success: boolean; reason?: string }) => {
|
|
50
|
+
if (!response?.success) {
|
|
51
|
+
showAlert?.({ message: response?.reason || 'Failed to focus panelists', type: 'danger', duration: 3000 });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const unfocusPanelists = async ({
|
|
58
|
+
socket,
|
|
59
|
+
roomName,
|
|
60
|
+
member: _member,
|
|
61
|
+
islevel,
|
|
62
|
+
showAlert,
|
|
63
|
+
}: UnfocusPanelistsOptions): Promise<void> => {
|
|
64
|
+
if (islevel !== '2') {
|
|
65
|
+
showAlert?.({ message: 'Only the host can unfocus panelists', type: 'danger', duration: 3000 });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
socket.emit(
|
|
70
|
+
'focusPanelists',
|
|
71
|
+
{
|
|
72
|
+
roomName,
|
|
73
|
+
focusEnabled: false,
|
|
74
|
+
muteOthersMic: false,
|
|
75
|
+
muteOthersCamera: false,
|
|
76
|
+
},
|
|
77
|
+
(response: { success: boolean; reason?: string }) => {
|
|
78
|
+
if (!response?.success) {
|
|
79
|
+
showAlert?.({ message: response?.reason || 'Failed to unfocus panelists', type: 'danger', duration: 3000 });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LaunchPanelistsOptions {
|
|
2
|
+
updateIsPanelistsModalVisible: (visible: boolean) => void;
|
|
3
|
+
isPanelistsModalVisible: boolean;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type LaunchPanelistsType = (options: LaunchPanelistsOptions) => void;
|
|
7
|
+
|
|
8
|
+
export const launchPanelists = ({
|
|
9
|
+
updateIsPanelistsModalVisible,
|
|
10
|
+
isPanelistsModalVisible,
|
|
11
|
+
}: LaunchPanelistsOptions): void => {
|
|
12
|
+
updateIsPanelistsModalVisible(!isPanelistsModalVisible);
|
|
13
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Socket } from 'socket.io-client';
|
|
2
|
+
import type { Participant, ShowAlert } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
export interface UpdatePanelistsOptions {
|
|
5
|
+
socket: Socket;
|
|
6
|
+
panelists: Participant[];
|
|
7
|
+
roomName: string;
|
|
8
|
+
member: string;
|
|
9
|
+
islevel: string;
|
|
10
|
+
showAlert?: ShowAlert;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AddPanelistOptions {
|
|
14
|
+
socket: Socket;
|
|
15
|
+
participant: Participant;
|
|
16
|
+
currentPanelists: Participant[];
|
|
17
|
+
maxPanelists: number;
|
|
18
|
+
roomName: string;
|
|
19
|
+
member: string;
|
|
20
|
+
islevel: string;
|
|
21
|
+
showAlert?: ShowAlert;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RemovePanelistOptions {
|
|
25
|
+
socket: Socket;
|
|
26
|
+
participant: Participant;
|
|
27
|
+
roomName: string;
|
|
28
|
+
member: string;
|
|
29
|
+
islevel: string;
|
|
30
|
+
showAlert?: ShowAlert;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type UpdatePanelistsType = (options: UpdatePanelistsOptions) => Promise<void>;
|
|
34
|
+
export type AddPanelistType = (options: AddPanelistOptions) => Promise<boolean>;
|
|
35
|
+
export type RemovePanelistType = (options: RemovePanelistOptions) => Promise<void>;
|
|
36
|
+
|
|
37
|
+
export const updatePanelists = async ({
|
|
38
|
+
socket,
|
|
39
|
+
panelists,
|
|
40
|
+
roomName,
|
|
41
|
+
member: _member,
|
|
42
|
+
islevel,
|
|
43
|
+
showAlert,
|
|
44
|
+
}: UpdatePanelistsOptions): Promise<void> => {
|
|
45
|
+
if (islevel !== '2') {
|
|
46
|
+
showAlert?.({ message: 'Only the host can update panelists', type: 'danger', duration: 3000 });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
socket.emit(
|
|
51
|
+
'updatePanelists',
|
|
52
|
+
{
|
|
53
|
+
panelists: panelists.map((p) => ({ id: p.id, name: p.name })),
|
|
54
|
+
roomName,
|
|
55
|
+
},
|
|
56
|
+
(response: { success: boolean; reason?: string }) => {
|
|
57
|
+
if (!response?.success) {
|
|
58
|
+
showAlert?.({ message: response?.reason || 'Failed to update panelists', type: 'danger', duration: 3000 });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const addPanelist = async ({
|
|
65
|
+
socket,
|
|
66
|
+
participant,
|
|
67
|
+
currentPanelists,
|
|
68
|
+
maxPanelists,
|
|
69
|
+
roomName,
|
|
70
|
+
member: _member,
|
|
71
|
+
islevel,
|
|
72
|
+
showAlert,
|
|
73
|
+
}: AddPanelistOptions): Promise<boolean> => {
|
|
74
|
+
if (islevel !== '2') {
|
|
75
|
+
showAlert?.({ message: 'Only the host can add panelists', type: 'danger', duration: 3000 });
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (currentPanelists.some((p) => p.id === participant.id)) {
|
|
80
|
+
showAlert?.({ message: `${participant.name} is already a panelist`, type: 'success', duration: 3000 });
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (currentPanelists.length >= maxPanelists) {
|
|
85
|
+
showAlert?.({ message: `Maximum panelist limit (${maxPanelists}) reached`, type: 'danger', duration: 3000 });
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return new Promise((resolve) => {
|
|
90
|
+
socket.emit(
|
|
91
|
+
'addPanelist',
|
|
92
|
+
{
|
|
93
|
+
participantId: participant.id,
|
|
94
|
+
participantName: participant.name,
|
|
95
|
+
roomName,
|
|
96
|
+
},
|
|
97
|
+
(response: { success: boolean; reason?: string }) => {
|
|
98
|
+
if (!response?.success) {
|
|
99
|
+
showAlert?.({ message: response?.reason || 'Failed to add panelist', type: 'danger', duration: 3000 });
|
|
100
|
+
resolve(false);
|
|
101
|
+
} else {
|
|
102
|
+
resolve(true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const removePanelist = async ({
|
|
110
|
+
socket,
|
|
111
|
+
participant,
|
|
112
|
+
roomName,
|
|
113
|
+
member: _member,
|
|
114
|
+
islevel,
|
|
115
|
+
showAlert,
|
|
116
|
+
}: RemovePanelistOptions): Promise<void> => {
|
|
117
|
+
if (islevel !== '2') {
|
|
118
|
+
showAlert?.({ message: 'Only the host can remove panelists', type: 'danger', duration: 3000 });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
socket.emit(
|
|
123
|
+
'removePanelist',
|
|
124
|
+
{
|
|
125
|
+
participantId: participant.id,
|
|
126
|
+
participantName: participant.name,
|
|
127
|
+
roomName,
|
|
128
|
+
},
|
|
129
|
+
(response: { success: boolean; reason?: string }) => {
|
|
130
|
+
if (!response?.success) {
|
|
131
|
+
showAlert?.({ message: response?.reason || 'Failed to remove panelist', type: 'danger', duration: 3000 });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LaunchPermissionsOptions {
|
|
2
|
+
updateIsPermissionsModalVisible: (visible: boolean) => void;
|
|
3
|
+
isPermissionsModalVisible: boolean;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type LaunchPermissionsType = (options: LaunchPermissionsOptions) => void;
|
|
7
|
+
|
|
8
|
+
export const launchPermissions = ({
|
|
9
|
+
updateIsPermissionsModalVisible,
|
|
10
|
+
isPermissionsModalVisible,
|
|
11
|
+
}: LaunchPermissionsOptions): void => {
|
|
12
|
+
updateIsPermissionsModalVisible(!isPermissionsModalVisible);
|
|
13
|
+
};
|