mediasfu-shared 1.0.3 → 1.0.5
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/README.md +108 -103
- package/dist/index.cjs +162 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +162 -5
- package/dist/index.js.map +1 -1
- package/package.json +99 -96
- package/src/index.native.ts +220 -0
- package/src/index.ts +23 -1
- package/src/methods/message/sendMessage.ts +7 -3
- package/src/methods/utils/resolveMediaSFURoomApi.ts +4 -1
- package/src/methods/utils/translationLanguages.ts +64 -2
package/package.json
CHANGED
|
@@ -1,96 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mediasfu-shared",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "dist/index.cjs",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
},
|
|
15
|
-
"./consumers": {
|
|
16
|
-
"types": "./dist/consumers/index.d.ts",
|
|
17
|
-
"import": "./dist/consumers/index.js",
|
|
18
|
-
"require": "./dist/consumers/index.cjs"
|
|
19
|
-
},
|
|
20
|
-
"./methods": {
|
|
21
|
-
"types": "./dist/methods/index.d.ts",
|
|
22
|
-
"import": "./dist/methods/index.js",
|
|
23
|
-
"require": "./dist/methods/index.cjs"
|
|
24
|
-
},
|
|
25
|
-
"./types": {
|
|
26
|
-
"types": "./dist/types/index.d.ts",
|
|
27
|
-
"import": "./dist/types/index.js",
|
|
28
|
-
"require": "./dist/types/index.cjs"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"dist",
|
|
33
|
-
"src",
|
|
34
|
-
"README.md",
|
|
35
|
-
"LICENSE"
|
|
36
|
-
],
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "tsc && vite build",
|
|
39
|
-
"build-docs": "typedoc",
|
|
40
|
-
"dev": "vite build --watch",
|
|
41
|
-
"test:staging:smoke": "npm run build && node ./scripts/staging-room-smoke-test.cjs",
|
|
42
|
-
"type-check": "tsc --noEmit"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"mediasfu",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"mediasoup",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"video
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
},
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "mediasfu-shared",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "mediasfu-shared – framework-agnostic WebRTC runtime for MediaSFU. Room helpers, mediasoup signaling, socket management, media state, and TypeScript types for React, Vue, Angular, Svelte, and plain TS.",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./consumers": {
|
|
16
|
+
"types": "./dist/consumers/index.d.ts",
|
|
17
|
+
"import": "./dist/consumers/index.js",
|
|
18
|
+
"require": "./dist/consumers/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./methods": {
|
|
21
|
+
"types": "./dist/methods/index.d.ts",
|
|
22
|
+
"import": "./dist/methods/index.js",
|
|
23
|
+
"require": "./dist/methods/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./types": {
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"import": "./dist/types/index.js",
|
|
28
|
+
"require": "./dist/types/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc && vite build",
|
|
39
|
+
"build-docs": "typedoc",
|
|
40
|
+
"dev": "vite build --watch",
|
|
41
|
+
"test:staging:smoke": "npm run build && node ./scripts/staging-room-smoke-test.cjs",
|
|
42
|
+
"type-check": "tsc --noEmit"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"mediasfu",
|
|
46
|
+
"mediasfu-shared",
|
|
47
|
+
"webrtc",
|
|
48
|
+
"mediasoup",
|
|
49
|
+
"socket.io",
|
|
50
|
+
"sfu",
|
|
51
|
+
"video conferencing",
|
|
52
|
+
"video call",
|
|
53
|
+
"webinar",
|
|
54
|
+
"live streaming",
|
|
55
|
+
"recording",
|
|
56
|
+
"whiteboard",
|
|
57
|
+
"translation",
|
|
58
|
+
"live subtitles",
|
|
59
|
+
"room management",
|
|
60
|
+
"screen sharing",
|
|
61
|
+
"real-time communication",
|
|
62
|
+
"framework-agnostic",
|
|
63
|
+
"typescript",
|
|
64
|
+
"react",
|
|
65
|
+
"vue",
|
|
66
|
+
"angular",
|
|
67
|
+
"svelte",
|
|
68
|
+
"mediasfu sdk",
|
|
69
|
+
"mediasfu runtime",
|
|
70
|
+
"mediasfu shared"
|
|
71
|
+
],
|
|
72
|
+
"author": "MediaSFU",
|
|
73
|
+
"license": "MIT",
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "https://github.com/MediaSFU/MediaSFU-Shared"
|
|
77
|
+
},
|
|
78
|
+
"homepage": "https://www.npmjs.com/package/mediasfu-shared",
|
|
79
|
+
"bugs": {
|
|
80
|
+
"url": "https://github.com/MediaSFU/MediaSFU-Shared/issues",
|
|
81
|
+
"email": "info@mediasfu.com"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"mediasoup-client": "^3.20.0",
|
|
85
|
+
"socket.io-client": "^4.8.0"
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"universal-cookie": "^7.2.2"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"mediasoup-client": "^3.20.0",
|
|
92
|
+
"socket.io-client": "^4.8.0",
|
|
93
|
+
"typedoc": "^0.28.14",
|
|
94
|
+
"typedoc-plugin-extras": "^4.0.1",
|
|
95
|
+
"typescript": "^5.9.3",
|
|
96
|
+
"vite": "^7.1.9",
|
|
97
|
+
"vite-plugin-dts": "^4.3.0"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export * from './consumers/autoAdjust';
|
|
2
|
+
export * from './consumers/calculateRowsAndColumns';
|
|
3
|
+
export * from './consumers/changeVids';
|
|
4
|
+
export * from './consumers/checkGrid';
|
|
5
|
+
export * from './consumers/checkPermission';
|
|
6
|
+
export * from './consumers/checkScreenShare';
|
|
7
|
+
export * from './consumers/closeAndResize';
|
|
8
|
+
export * from './consumers/compareActiveNames';
|
|
9
|
+
export * from './consumers/compareScreenStates';
|
|
10
|
+
export * from './consumers/gridLayout/addVideosGrid.engine';
|
|
11
|
+
export * from './consumers/gridLayout/prepopulateUserMedia.engine';
|
|
12
|
+
export * from './consumers/connectIps';
|
|
13
|
+
export * from './consumers/connectLocalIps';
|
|
14
|
+
export * from './consumers/connectRecvTransport';
|
|
15
|
+
export * from './consumers/connectSendTransport';
|
|
16
|
+
export * from './consumers/connectSendTransportAudio';
|
|
17
|
+
export * from './consumers/consumerResume';
|
|
18
|
+
export * from './consumers/connectSendTransportScreen';
|
|
19
|
+
export * from './consumers/connectSendTransportVideo';
|
|
20
|
+
export * from './consumers/controlMedia';
|
|
21
|
+
export * from './consumers/createSendTransport';
|
|
22
|
+
export * from './consumers/disconnectSendTransportAudio';
|
|
23
|
+
export * from './consumers/disconnectSendTransportScreen';
|
|
24
|
+
export * from './consumers/disconnectSendTransportVideo';
|
|
25
|
+
export * from './consumers/dispStreams';
|
|
26
|
+
export * from './consumers/generatePageContent';
|
|
27
|
+
export * from './consumers/getEstimate';
|
|
28
|
+
export * from './consumers/getPipedProducersAlt';
|
|
29
|
+
export * from './consumers/getProducersPiped';
|
|
30
|
+
export * from './consumers/getVideos';
|
|
31
|
+
export * from './consumers/mixStreams';
|
|
32
|
+
export * from './consumers/onScreenChanges';
|
|
33
|
+
export * from './consumers/processConsumerTransports';
|
|
34
|
+
export * from './consumers/processConsumerTransportsAudio';
|
|
35
|
+
export * from './consumers/readjust';
|
|
36
|
+
export * from './consumers/receiveAllPipedTransports';
|
|
37
|
+
export * from './consumers/receiveRoomMessages';
|
|
38
|
+
export * from './consumers/reorderStreams';
|
|
39
|
+
export * from './consumers/rePort';
|
|
40
|
+
export * from './consumers/requestScreenShare';
|
|
41
|
+
export * from './consumers/resumePauseAudioStreams';
|
|
42
|
+
export * from './consumers/resumePauseStreams';
|
|
43
|
+
export * from './consumers/resumeSendTransportAudio';
|
|
44
|
+
export * from './consumers/reUpdateInter';
|
|
45
|
+
export * from './consumers/signalNewConsumerTransport';
|
|
46
|
+
export * from './consumers/socketReceiveMethods/joinConsumeRoom';
|
|
47
|
+
export * from './consumers/socketReceiveMethods/newPipeProducer';
|
|
48
|
+
export * from './consumers/socketReceiveMethods/producerClosed';
|
|
49
|
+
export * from './consumers/startShareScreen';
|
|
50
|
+
export * from './consumers/stopShareScreen';
|
|
51
|
+
export * from './consumers/streamSuccessAudio';
|
|
52
|
+
export * from './consumers/streamSuccessAudioSwitch';
|
|
53
|
+
export * from './consumers/streamSuccessScreen';
|
|
54
|
+
export * from './consumers/streamSuccessVideo';
|
|
55
|
+
export * from './consumers/switchUserAudio';
|
|
56
|
+
export * from './consumers/switchUserVideo';
|
|
57
|
+
export * from './consumers/switchUserVideoAlt';
|
|
58
|
+
export * from './consumers/translationConsumerSwitch';
|
|
59
|
+
export * from './consumers/trigger';
|
|
60
|
+
export * from './consumers/updateMiniCardsGrid';
|
|
61
|
+
export * from './consumers/updateParticipantAudioDecibels';
|
|
62
|
+
|
|
63
|
+
export * from './methods/background/launchBackground';
|
|
64
|
+
export * from './methods/breakoutRooms/breakoutRoomUpdated';
|
|
65
|
+
export * from './methods/breakoutRooms/handleStartBreakout';
|
|
66
|
+
export * from './methods/breakoutRooms/handleStopBreakout';
|
|
67
|
+
export * from './methods/breakoutRooms/launchBreakoutRooms';
|
|
68
|
+
export * from './methods/coHost/launchCoHost';
|
|
69
|
+
export * from './methods/coHostMethods/modifyCoHostSettings';
|
|
70
|
+
export * from './methods/displaySettings/launchDisplaySettings';
|
|
71
|
+
export * from './methods/displaySettings/modifyDisplaySettings';
|
|
72
|
+
export * from './methods/exit/confirmExit';
|
|
73
|
+
export * from './methods/exit/launchConfirmExit';
|
|
74
|
+
export * from './methods/mediaSettings/launchMediaSettings';
|
|
75
|
+
export * from './methods/menu/launchMenuModal';
|
|
76
|
+
export * from './methods/message/launchMessages';
|
|
77
|
+
export * from './methods/message/sendMessage';
|
|
78
|
+
export * from './methods/participants/launchParticipants';
|
|
79
|
+
export * from './methods/participants/messageParticipants';
|
|
80
|
+
export * from './methods/participants/muteParticipants';
|
|
81
|
+
export * from './methods/participants/removeParticipants';
|
|
82
|
+
export * from './methods/panelists/launchPanelists';
|
|
83
|
+
export * from './methods/panelists/updatePanelists';
|
|
84
|
+
export * from './methods/panelists/focusPanelists';
|
|
85
|
+
export * from './methods/permissions/launchPermissions';
|
|
86
|
+
export * from './methods/permissions/updateParticipantPermission';
|
|
87
|
+
export * from './methods/permissions/updatePermissionConfig';
|
|
88
|
+
export * from './methods/polls/handleCreatePoll';
|
|
89
|
+
export * from './methods/polls/handleEndPoll';
|
|
90
|
+
export * from './methods/polls/handleVotePoll';
|
|
91
|
+
export * from './methods/polls/launchPoll';
|
|
92
|
+
export * from './methods/polls/pollUpdated';
|
|
93
|
+
export * from './methods/prejoin/handleCreateRoom';
|
|
94
|
+
export * from './methods/prejoin/handleJoinRoom';
|
|
95
|
+
export * from './methods/recording/checkPauseState';
|
|
96
|
+
export * from './methods/recording/checkResumeState';
|
|
97
|
+
export * from './methods/recording/confirmRecording';
|
|
98
|
+
export * from './methods/recording/launchRecording';
|
|
99
|
+
export * from './methods/recording/recordPauseTimer';
|
|
100
|
+
export * from './methods/recording/recordResumeTimer';
|
|
101
|
+
export * from './methods/recording/recordStartTimer';
|
|
102
|
+
export * from './methods/recording/recordUpdateTimer';
|
|
103
|
+
export * from './methods/recording/startRecording';
|
|
104
|
+
export * from './methods/recording/stopRecording';
|
|
105
|
+
export * from './methods/recording/timeLeftRecording';
|
|
106
|
+
export * from './methods/recording/updateRecording';
|
|
107
|
+
export * from './methods/requests/launchRequests';
|
|
108
|
+
export * from './methods/requests/hostRequestResponse';
|
|
109
|
+
export * from './methods/requests/respondToRequests';
|
|
110
|
+
export * from './methods/settings/launchSettings';
|
|
111
|
+
export * from './methods/settings/modifySettings';
|
|
112
|
+
export * from './methods/stream/switchAudio';
|
|
113
|
+
export * from './methods/stream/switchVideo';
|
|
114
|
+
export * from './methods/stream/switchVideoAlt';
|
|
115
|
+
export * from './methods/stream/clickAudio';
|
|
116
|
+
export * from './methods/stream/clickChat';
|
|
117
|
+
export * from './methods/stream/clickScreenShare';
|
|
118
|
+
export * from './methods/utils/liveSubtitle';
|
|
119
|
+
export * from './methods/utils/translationLanguages';
|
|
120
|
+
export * from './methods/utils/SoundPlayer';
|
|
121
|
+
export * from './methods/utils/getOverlayPosition';
|
|
122
|
+
export * from './methods/utils/getModalPosition';
|
|
123
|
+
export * from './methods/utils/sleep';
|
|
124
|
+
export * from './methods/utils/formatNumber';
|
|
125
|
+
export * from './methods/utils/generateRandomMessages';
|
|
126
|
+
export * from './methods/utils/generateRandomParticipants';
|
|
127
|
+
export * from './methods/utils/generateRandomPolls';
|
|
128
|
+
export * from './methods/utils/generateRandomRequestList';
|
|
129
|
+
export * from './methods/utils/generateRandomWaitingRoomList';
|
|
130
|
+
export * from './methods/utils/initialValuesState';
|
|
131
|
+
export * from './methods/utils/webrtc';
|
|
132
|
+
export * from './methods/utils/checkLimitsAndMakeRequest';
|
|
133
|
+
export * from './methods/utils/createResponseJoinRoom';
|
|
134
|
+
export * from './methods/utils/joinRoomOnMediaSFU';
|
|
135
|
+
export * from './methods/utils/createRoomOnMediaSFU';
|
|
136
|
+
export * from './methods/utils/meetingTimer/startMeetingProgressTimer';
|
|
137
|
+
export * from './methods/utils/meetingTimeRemaining';
|
|
138
|
+
export * from './methods/utils/producer/aParams';
|
|
139
|
+
export * from './methods/utils/producer/hParams';
|
|
140
|
+
export * from './methods/utils/producer/vParams';
|
|
141
|
+
export * from './methods/utils/producer/screenParams';
|
|
142
|
+
export * from './methods/utils/producer/videoCaptureConstraints';
|
|
143
|
+
export * from './methods/utils/validateAlphanumeric';
|
|
144
|
+
export * from './methods/socketReceive/allWaitingRoomMembers';
|
|
145
|
+
export * from './methods/socketReceive/allMembers';
|
|
146
|
+
export * from './methods/socketReceive/allMembersRest';
|
|
147
|
+
export * from './methods/socketReceive/banParticipant';
|
|
148
|
+
export * from './methods/socketReceive/controlMediaHost';
|
|
149
|
+
export * from './methods/socketReceive/disconnect';
|
|
150
|
+
export * from './methods/socketReceive/disconnectUserSelf';
|
|
151
|
+
export * from './methods/socketReceive/getDomains';
|
|
152
|
+
export * from './methods/socketReceive/meetingEnded';
|
|
153
|
+
export * from './methods/socketReceive/meetingStillThere';
|
|
154
|
+
export {
|
|
155
|
+
type PanelistData,
|
|
156
|
+
type PanelistsUpdatedData,
|
|
157
|
+
type PanelistFocusChangedData,
|
|
158
|
+
type ControlMediaData,
|
|
159
|
+
type AddedAsPanelistData,
|
|
160
|
+
type RemovedFromPanelistsData,
|
|
161
|
+
type PanelistsUpdatedOptions,
|
|
162
|
+
type PanelistFocusChangedOptions,
|
|
163
|
+
type ControlMediaOptions as PanelistControlMediaOptions,
|
|
164
|
+
type AddedAsPanelistOptions,
|
|
165
|
+
type RemovedFromPanelistsOptions,
|
|
166
|
+
type PanelistsUpdatedType,
|
|
167
|
+
type PanelistFocusChangedType,
|
|
168
|
+
type ControlMediaType as PanelistControlMediaType,
|
|
169
|
+
type AddedAsPanelistType,
|
|
170
|
+
type RemovedFromPanelistsType,
|
|
171
|
+
panelistsUpdated,
|
|
172
|
+
panelistFocusChanged,
|
|
173
|
+
panelistControlMedia,
|
|
174
|
+
addedAsPanelist,
|
|
175
|
+
removedFromPanelists,
|
|
176
|
+
} from './methods/socketReceive/panelistReceiveMethods';
|
|
177
|
+
export * from './methods/socketReceive/participantRequested';
|
|
178
|
+
export * from './methods/socketReceive/permissionReceiveMethods';
|
|
179
|
+
export * from './methods/socketReceive/personJoined';
|
|
180
|
+
export * from './methods/socketReceive/producerMediaClosed';
|
|
181
|
+
export * from './methods/socketReceive/producerMediaPaused';
|
|
182
|
+
export * from './methods/socketReceive/producerMediaResumed';
|
|
183
|
+
export * from './methods/socketReceive/receiveMessage';
|
|
184
|
+
export * from './methods/socketReceive/recordingNotice';
|
|
185
|
+
export * from './methods/socketReceive/reInitiateRecording';
|
|
186
|
+
export * from './methods/socketReceive/roomRecordParams';
|
|
187
|
+
export * from './methods/socketReceive/screenProducerId';
|
|
188
|
+
export * from './methods/socketReceive/startRecords';
|
|
189
|
+
export * from './methods/socketReceive/stoppedRecording';
|
|
190
|
+
export * from './methods/socketReceive/translationReceiveMethods';
|
|
191
|
+
export * from './methods/socketReceive/updateMediaSettings';
|
|
192
|
+
export * from './methods/socketReceive/updateConsumingDomains';
|
|
193
|
+
export * from './methods/socketReceive/updatedCoHost';
|
|
194
|
+
export * from './methods/socketReceive/userWaiting';
|
|
195
|
+
export * from './methods/waiting/launchWaiting';
|
|
196
|
+
export * from './methods/waiting/respondToWaiting';
|
|
197
|
+
export {
|
|
198
|
+
handleWelcomeRequest,
|
|
199
|
+
validateAlphanumeric as validateWelcomeAlphanumeric,
|
|
200
|
+
validateWelcomeInputs,
|
|
201
|
+
} from './methods/welcome/handleWelcomeRequest';
|
|
202
|
+
export type {
|
|
203
|
+
HandleWelcomeRequestOptions,
|
|
204
|
+
ValidateWelcomeInputsOptions,
|
|
205
|
+
} from './methods/welcome/handleWelcomeRequest';
|
|
206
|
+
export * from './methods/whiteboard/handleStartWhiteboard';
|
|
207
|
+
export * from './methods/whiteboard/handleStopWhiteboard';
|
|
208
|
+
export * from './methods/whiteboard/launchConfigureWhiteboard';
|
|
209
|
+
export * from './methods/whiteboard/captureCanvasStream';
|
|
210
|
+
|
|
211
|
+
export * from './ProducerClient/producerClientEmits/joinRoomClient';
|
|
212
|
+
export * from './ProducerClient/producerClientEmits/updateRoomParametersClient';
|
|
213
|
+
|
|
214
|
+
export * from './producers/producerEmits/joinConRoom';
|
|
215
|
+
export * from './producers/producerEmits/joinLocalRoom';
|
|
216
|
+
export * from './producers/producerEmits/joinRoom';
|
|
217
|
+
|
|
218
|
+
export * from './sockets/SocketManager';
|
|
219
|
+
|
|
220
|
+
export * from './methods/stream/clickVideo';
|
package/src/index.ts
CHANGED
|
@@ -155,7 +155,29 @@ export * from './methods/socketReceive/disconnectUserSelf';
|
|
|
155
155
|
export * from './methods/socketReceive/getDomains';
|
|
156
156
|
export * from './methods/socketReceive/meetingEnded';
|
|
157
157
|
export * from './methods/socketReceive/meetingStillThere';
|
|
158
|
-
export
|
|
158
|
+
export {
|
|
159
|
+
type PanelistData,
|
|
160
|
+
type PanelistsUpdatedData,
|
|
161
|
+
type PanelistFocusChangedData,
|
|
162
|
+
type ControlMediaData,
|
|
163
|
+
type AddedAsPanelistData,
|
|
164
|
+
type RemovedFromPanelistsData,
|
|
165
|
+
type PanelistsUpdatedOptions,
|
|
166
|
+
type PanelistFocusChangedOptions,
|
|
167
|
+
type ControlMediaOptions as PanelistControlMediaOptions,
|
|
168
|
+
type AddedAsPanelistOptions,
|
|
169
|
+
type RemovedFromPanelistsOptions,
|
|
170
|
+
type PanelistsUpdatedType,
|
|
171
|
+
type PanelistFocusChangedType,
|
|
172
|
+
type ControlMediaType as PanelistControlMediaType,
|
|
173
|
+
type AddedAsPanelistType,
|
|
174
|
+
type RemovedFromPanelistsType,
|
|
175
|
+
panelistsUpdated,
|
|
176
|
+
panelistFocusChanged,
|
|
177
|
+
panelistControlMedia,
|
|
178
|
+
addedAsPanelist,
|
|
179
|
+
removedFromPanelists,
|
|
180
|
+
} from './methods/socketReceive/panelistReceiveMethods';
|
|
159
181
|
export * from './methods/socketReceive/participantRequested';
|
|
160
182
|
export * from './methods/socketReceive/permissionReceiveMethods';
|
|
161
183
|
export * from './methods/socketReceive/personJoined';
|
|
@@ -85,6 +85,9 @@ export const sendMessage = async ({
|
|
|
85
85
|
chatSetting,
|
|
86
86
|
}: SendMessageOptions): Promise<void> => {
|
|
87
87
|
let chatValue = false;
|
|
88
|
+
const normalizedReceivers = (receivers ?? []).filter(
|
|
89
|
+
(receiver): receiver is string => typeof receiver === "string" && receiver.trim().length > 0,
|
|
90
|
+
);
|
|
88
91
|
|
|
89
92
|
// Check message count limit based on room type prefix
|
|
90
93
|
if (
|
|
@@ -110,8 +113,9 @@ export const sendMessage = async ({
|
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
//
|
|
114
|
-
|
|
116
|
+
// Hosts need an explicit recipient. Attendees can open a direct thread to the host
|
|
117
|
+
// without first replying to an existing message.
|
|
118
|
+
if (normalizedReceivers.length < 1 && group === false && islevel === "2") {
|
|
115
119
|
showAlert?.({
|
|
116
120
|
message: "Please select a message to reply to",
|
|
117
121
|
type: "danger",
|
|
@@ -123,7 +127,7 @@ export const sendMessage = async ({
|
|
|
123
127
|
// Create message object
|
|
124
128
|
const messageObject: Message = {
|
|
125
129
|
sender: sender ? sender : member,
|
|
126
|
-
receivers:
|
|
130
|
+
receivers: normalizedReceivers,
|
|
127
131
|
message: message,
|
|
128
132
|
timestamp: new Date().toLocaleTimeString(),
|
|
129
133
|
group: group !== undefined && group !== null ? group : false,
|
|
@@ -2,6 +2,9 @@ const DEFAULT_MEDIA_SFU_ROOM_API_URL = 'https://mediasfu.com/v1/rooms/';
|
|
|
2
2
|
|
|
3
3
|
type MediaSFURoomApiAction = 'createRoom' | 'joinRoom';
|
|
4
4
|
|
|
5
|
+
const getDefaultMediaSFURoomApiUrl = (): string =>
|
|
6
|
+
DEFAULT_MEDIA_SFU_ROOM_API_URL;
|
|
7
|
+
|
|
5
8
|
const normalizeManagedRoomApi = (normalizedLink: string): string => {
|
|
6
9
|
if (normalizedLink.includes('/v1/rooms')) {
|
|
7
10
|
return `${normalizedLink.replace(/\/$/, '')}/`;
|
|
@@ -17,7 +20,7 @@ export const resolveMediaSFURoomApi = (
|
|
|
17
20
|
const normalizedLink = localLink?.trim();
|
|
18
21
|
|
|
19
22
|
if (!normalizedLink) {
|
|
20
|
-
return
|
|
23
|
+
return getDefaultMediaSFURoomApiUrl();
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
if (normalizedLink.includes('mediasfu.com')) {
|
|
@@ -105,13 +105,45 @@ const TTS_SUPPORT_BY_LANGUAGE: Record<string, TTSSupport> = {
|
|
|
105
105
|
auto: 'n/a',
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
/** Static English language names used as a fallback when Intl.DisplayNames is
|
|
109
|
+
* unavailable or returns an empty string (e.g. older Hermes on Android). */
|
|
110
|
+
const LANGUAGE_NAMES_EN: Record<string, string> = {
|
|
111
|
+
en: 'English', es: 'Spanish', fr: 'French', de: 'German', it: 'Italian',
|
|
112
|
+
pt: 'Portuguese', nl: 'Dutch', ru: 'Russian', zh: 'Chinese', ja: 'Japanese',
|
|
113
|
+
ko: 'Korean', ar: 'Arabic', hi: 'Hindi', bn: 'Bengali', pa: 'Punjabi',
|
|
114
|
+
te: 'Telugu', mr: 'Marathi', ta: 'Tamil', ur: 'Urdu', gu: 'Gujarati',
|
|
115
|
+
kn: 'Kannada', ml: 'Malayalam', ne: 'Nepali', si: 'Sinhala',
|
|
116
|
+
tr: 'Turkish', pl: 'Polish', vi: 'Vietnamese', th: 'Thai',
|
|
117
|
+
id: 'Indonesian', ms: 'Malay', tl: 'Filipino', km: 'Khmer',
|
|
118
|
+
lo: 'Lao', my: 'Burmese',
|
|
119
|
+
sw: 'Swahili', yo: 'Yoruba', ha: 'Hausa', ig: 'Igbo', zu: 'Zulu',
|
|
120
|
+
xh: 'Xhosa', af: 'Afrikaans', st: 'Sesotho', tn: 'Tswana', sn: 'Shona',
|
|
121
|
+
am: 'Amharic', so: 'Somali', rw: 'Kinyarwanda', mg: 'Malagasy',
|
|
122
|
+
ny: 'Chichewa', ee: 'Ewe', tw: 'Twi', gaa: 'Ga',
|
|
123
|
+
he: 'Hebrew', fa: 'Persian', ps: 'Pashto', ku: 'Kurdish',
|
|
124
|
+
uk: 'Ukrainian', el: 'Greek', cs: 'Czech', ro: 'Romanian',
|
|
125
|
+
hu: 'Hungarian', sv: 'Swedish', da: 'Danish', no: 'Norwegian',
|
|
126
|
+
fi: 'Finnish', sk: 'Slovak', bg: 'Bulgarian', hr: 'Croatian',
|
|
127
|
+
et: 'Estonian', lt: 'Lithuanian', lv: 'Latvian', sl: 'Slovenian',
|
|
128
|
+
sr: 'Serbian', bs: 'Bosnian', mk: 'Macedonian', is: 'Icelandic',
|
|
129
|
+
ga: 'Irish', cy: 'Welsh', mt: 'Maltese', lb: 'Luxembourgish',
|
|
130
|
+
sq: 'Albanian', be: 'Belarusian',
|
|
131
|
+
ka: 'Georgian', hy: 'Armenian', az: 'Azerbaijani',
|
|
132
|
+
eu: 'Basque', gl: 'Galician', ca: 'Catalan', la: 'Latin', eo: 'Esperanto',
|
|
133
|
+
kk: 'Kazakh', uz: 'Uzbek', tg: 'Tajik', ky: 'Kyrgyz', tk: 'Turkmen',
|
|
134
|
+
mn: 'Mongolian',
|
|
135
|
+
};
|
|
136
|
+
|
|
108
137
|
const getDisplayName = (code: string, locale: string, fallback: string) => {
|
|
109
138
|
try {
|
|
110
139
|
const displayNames = new Intl.DisplayNames([locale], { type: 'language' });
|
|
111
|
-
|
|
140
|
+
const result = displayNames.of(code);
|
|
141
|
+
if (result) return result;
|
|
112
142
|
} catch {
|
|
113
|
-
|
|
143
|
+
// Intl.DisplayNames unavailable on this runtime (e.g. older Hermes)
|
|
114
144
|
}
|
|
145
|
+
// Fall back to the static English map, then the uppercase-code fallback.
|
|
146
|
+
return LANGUAGE_NAMES_EN[code] ?? fallback;
|
|
115
147
|
};
|
|
116
148
|
|
|
117
149
|
export const normalizeLanguageCode = (code: string): string => {
|
|
@@ -169,6 +201,36 @@ export const getSupportedLanguages = (displayLocale = 'en'): LanguageOption[] =>
|
|
|
169
201
|
}).sort((left, right) => left.name.localeCompare(right.name));
|
|
170
202
|
};
|
|
171
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Curated list of the most widely-supported language codes for real-time translation.
|
|
206
|
+
* This set covers the languages supported by major STT/TTS/translation providers
|
|
207
|
+
* (Google, Azure, Deepgram, OpenAI, DeepL, etc.) and is the default shown in UI pickers.
|
|
208
|
+
* Use getSupportedLanguages() if you need the full extended list.
|
|
209
|
+
*/
|
|
210
|
+
export const COMMON_LANGUAGE_CODES: string[] = [
|
|
211
|
+
'en', 'es', 'fr', 'de', 'it', 'pt', 'nl', 'ru', 'zh', 'ja', 'ko', 'ar',
|
|
212
|
+
'hi', 'bn', 'tr', 'pl', 'vi', 'th', 'id', 'ms',
|
|
213
|
+
'sw', 'yo', 'ha', 'ig', 'zu', 'am', 'tw',
|
|
214
|
+
'he', 'fa', 'uk', 'el', 'cs', 'ro', 'hu', 'sv', 'da', 'no', 'fi',
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Returns the curated list of commonly-supported languages for translation UI pickers.
|
|
219
|
+
* Sorted alphabetically by display name.
|
|
220
|
+
*/
|
|
221
|
+
export const getCommonLanguages = (displayLocale = 'en'): LanguageOption[] => {
|
|
222
|
+
return COMMON_LANGUAGE_CODES.map((code) => {
|
|
223
|
+
const metadata = getLanguageMetadata(code);
|
|
224
|
+
return {
|
|
225
|
+
code,
|
|
226
|
+
name: getLanguageName(code, displayLocale),
|
|
227
|
+
nativeName: metadata.nativeName,
|
|
228
|
+
region: metadata.region,
|
|
229
|
+
ttsSupport: metadata.ttsSupport,
|
|
230
|
+
};
|
|
231
|
+
}).sort((left, right) => left.name.localeCompare(right.name));
|
|
232
|
+
};
|
|
233
|
+
|
|
172
234
|
export type TTSProvider =
|
|
173
235
|
| 'deepgram'
|
|
174
236
|
| 'openai'
|