@whereby.com/media 1.11.1 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +34 -15
- package/dist/index.d.cts +536 -529
- package/dist/index.d.mts +536 -529
- package/dist/index.d.ts +536 -529
- package/dist/index.mjs +34 -15
- package/dist/legacy-esm.js +34 -15
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -114,508 +114,179 @@ declare const MAXIMUM_TURN_BANDWIDTH = 1280;
|
|
|
114
114
|
declare const MAXIMUM_TURN_BANDWIDTH_UNLIMITED = -1;
|
|
115
115
|
declare const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
116
116
|
|
|
117
|
-
declare
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
declare const assert: {
|
|
118
|
+
fail: (message?: string | Error) => void;
|
|
119
|
+
ok: (value: any, message?: string | Error) => void;
|
|
120
|
+
equal?: (actual: any, expected: any, message?: string | Error) => void;
|
|
121
|
+
notEqual?: (actual: any, expected: any, message?: string | Error) => void;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare const createWorker: (fn: Function) => Worker;
|
|
125
|
+
declare const generateByteString: (count: number) => string;
|
|
126
|
+
|
|
127
|
+
declare const getHandler: () => mediasoup_client_lib_Device.BuiltinHandlerName | undefined;
|
|
128
|
+
|
|
129
|
+
declare const ipRegex: {
|
|
130
|
+
(options: {
|
|
131
|
+
exact: boolean;
|
|
132
|
+
includeBoundaries?: boolean;
|
|
133
|
+
}): RegExp;
|
|
134
|
+
v4(options: {
|
|
135
|
+
exact: boolean;
|
|
136
|
+
includeBoundaries?: boolean;
|
|
137
|
+
}): RegExp;
|
|
138
|
+
v6(options: {
|
|
139
|
+
exact: boolean;
|
|
140
|
+
includeBoundaries?: boolean;
|
|
141
|
+
}): RegExp;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: any) => {
|
|
145
|
+
encodings: {}[];
|
|
146
|
+
};
|
|
147
|
+
declare const modifyMediaCapabilities: (routerRtpCapabilities: any, features: any) => void;
|
|
148
|
+
|
|
149
|
+
declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
|
|
150
|
+
|
|
151
|
+
declare class ReconnectManager extends EventEmitter {
|
|
152
|
+
_socket: any;
|
|
153
|
+
_clients: any;
|
|
154
|
+
_signalDisconnectTime?: number;
|
|
155
|
+
rtcManager?: RtcManager;
|
|
156
|
+
metrics: {
|
|
157
|
+
roomJoinedLate: number;
|
|
158
|
+
pendingClientCanceled: number;
|
|
159
|
+
evaluationFailed: number;
|
|
160
|
+
roomJoined: number;
|
|
161
|
+
};
|
|
162
|
+
constructor(socket: any);
|
|
163
|
+
_onRoomJoined(payload: any): Promise<void>;
|
|
164
|
+
_onClientLeft(payload: any): void;
|
|
165
|
+
_onPendingClientLeft(payload: any): void;
|
|
166
|
+
_onNewClient(payload: any): void;
|
|
167
|
+
_abortIfNotActive(payload: any): Promise<void>;
|
|
168
|
+
_checkIsActive(clientId: string): Promise<boolean>;
|
|
169
|
+
_isClientMediaActive(stats: any, clientId: string): boolean;
|
|
170
|
+
_onAudioEnabled(payload: any): void;
|
|
171
|
+
_onVideoEnabled(payload: any): void;
|
|
172
|
+
_onScreenshareChanged(payload: any, action: boolean): void;
|
|
173
|
+
_hasClientStateChanged({ clientId, webcam, mic, screenShare, }: {
|
|
124
174
|
clientId: string;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
addNewStream(streamId: string, stream: MediaStream, isAudioEnabled: boolean, isVideoEnabled: boolean): void;
|
|
129
|
-
disconnect(streamId: string, activeBreakout: boolean | null, eventClaim?: string): void;
|
|
130
|
-
disconnectAll(): void;
|
|
131
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack, newTrack: CustomMediaStreamTrack): void;
|
|
132
|
-
removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string | null): void;
|
|
133
|
-
shouldAcceptStreamsFromBothSides?: () => boolean;
|
|
134
|
-
updateStreamResolution(streamId: string, ignored: null, resolution: {
|
|
135
|
-
width: number;
|
|
136
|
-
height: number;
|
|
137
|
-
}): void;
|
|
138
|
-
sendStatsCustomEvent(eventName: string, data: unknown): void;
|
|
139
|
-
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
140
|
-
selfId: string;
|
|
141
|
-
roomName: string;
|
|
142
|
-
isSfu: boolean;
|
|
175
|
+
webcam: boolean;
|
|
176
|
+
mic: boolean;
|
|
177
|
+
screenShare: boolean;
|
|
143
178
|
}): boolean;
|
|
144
|
-
|
|
145
|
-
|
|
179
|
+
_addClientToState(newClient: any): void;
|
|
180
|
+
_wasClientSendingMedia(clientId: string): any;
|
|
181
|
+
_getPendingClientsByDeviceId(deviceId: string): unknown[];
|
|
182
|
+
_resetClientState(payload: any): void;
|
|
146
183
|
}
|
|
147
|
-
|
|
148
|
-
|
|
184
|
+
|
|
185
|
+
declare class ServerSocket {
|
|
186
|
+
_socket: any;
|
|
187
|
+
_reconnectManager?: ReconnectManager | null;
|
|
188
|
+
noopKeepaliveInterval: any;
|
|
189
|
+
_wasConnectedUsingWebsocket?: boolean;
|
|
190
|
+
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean);
|
|
191
|
+
setRtcManager(rtcManager?: RtcManager): void;
|
|
192
|
+
connect(): void;
|
|
193
|
+
disconnect(): void;
|
|
194
|
+
disconnectOnConnect(): void;
|
|
195
|
+
emit(eventName: string, ...args: any[]): void;
|
|
196
|
+
emitIfConnected(eventName: string, data: any): void;
|
|
197
|
+
getTransport(): any;
|
|
198
|
+
getManager(): any;
|
|
199
|
+
isConnecting(): any;
|
|
200
|
+
isConnected(): any;
|
|
201
|
+
on(eventName: string, handler: Function): () => void;
|
|
202
|
+
once(eventName: string, handler: Function): void;
|
|
203
|
+
off(eventName: string, handler: Function): void;
|
|
204
|
+
_interceptEvent(eventName: string, handler: any): () => void;
|
|
205
|
+
getGlitchFreeMetrics(): {
|
|
206
|
+
roomJoinedLate: number;
|
|
207
|
+
pendingClientCanceled: number;
|
|
208
|
+
evaluationFailed: number;
|
|
209
|
+
roomJoined: number;
|
|
210
|
+
} | undefined;
|
|
149
211
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
212
|
+
|
|
213
|
+
declare const maybeTurnOnly: (transportConfig: any, features: {
|
|
214
|
+
useOnlyTURN: string;
|
|
215
|
+
}) => void;
|
|
216
|
+
|
|
217
|
+
interface Credentials {
|
|
218
|
+
credentials: {
|
|
219
|
+
uuid: string;
|
|
220
|
+
};
|
|
221
|
+
hmac: string;
|
|
222
|
+
userId: string;
|
|
155
223
|
}
|
|
156
|
-
interface
|
|
157
|
-
|
|
224
|
+
interface SocketConf {
|
|
225
|
+
host?: string;
|
|
226
|
+
path?: string;
|
|
227
|
+
reconnectionDelay?: number;
|
|
228
|
+
reconnectionDelayMax?: number;
|
|
229
|
+
timeout?: number;
|
|
230
|
+
autoConnect?: boolean;
|
|
231
|
+
}
|
|
232
|
+
interface SocketManager {
|
|
233
|
+
on: (eventName: string, callback: (args: unknown) => void) => void;
|
|
234
|
+
}
|
|
235
|
+
type RoleName = "none" | "visitor" | "granted_visitor" | "viewer" | "granted_viewer" | "host" | "recorder" | "streamer";
|
|
236
|
+
interface ClientRole {
|
|
237
|
+
roleName: RoleName;
|
|
238
|
+
}
|
|
239
|
+
interface SignalKnocker {
|
|
158
240
|
clientId: string;
|
|
159
|
-
|
|
160
|
-
|
|
241
|
+
displayName: string | null;
|
|
242
|
+
imageUrl: string | null;
|
|
243
|
+
liveVideo: boolean;
|
|
244
|
+
userAvatarUrl: string | null;
|
|
245
|
+
userId: string | null;
|
|
161
246
|
}
|
|
162
|
-
interface
|
|
247
|
+
interface SignalClient {
|
|
248
|
+
displayName: string;
|
|
249
|
+
id: string;
|
|
250
|
+
streams: string[];
|
|
251
|
+
isAudioEnabled: boolean;
|
|
252
|
+
isVideoEnabled: boolean;
|
|
253
|
+
role: ClientRole;
|
|
254
|
+
startedCloudRecordingAt: string | null;
|
|
255
|
+
externalId: string | null;
|
|
256
|
+
isDialIn: boolean;
|
|
257
|
+
}
|
|
258
|
+
interface Spotlight {
|
|
259
|
+
clientId: string;
|
|
163
260
|
streamId: string;
|
|
164
|
-
tracks: MediaStreamTrack[];
|
|
165
|
-
screenShare: boolean;
|
|
166
261
|
}
|
|
167
|
-
interface
|
|
168
|
-
|
|
169
|
-
|
|
262
|
+
interface AudioEnabledEvent {
|
|
263
|
+
clientId: string;
|
|
264
|
+
isAudioEnabled: boolean;
|
|
170
265
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
resolution?: string;
|
|
198
|
-
simulcast: boolean;
|
|
199
|
-
widescreen: boolean;
|
|
200
|
-
usingAspectRatio16x9: boolean;
|
|
201
|
-
};
|
|
202
|
-
type GetConstraintsOptions = {
|
|
203
|
-
devices: MediaDeviceInfo[];
|
|
204
|
-
audioId?: boolean | string;
|
|
205
|
-
videoId?: boolean | string;
|
|
206
|
-
type?: "ideal" | "exact";
|
|
207
|
-
options: Omit<GetMediaConstraintsOptions, "preferredDeviceIds">;
|
|
208
|
-
};
|
|
209
|
-
type GetStreamOptions = {
|
|
210
|
-
replaceStream?: MediaStream;
|
|
211
|
-
fallback?: boolean;
|
|
212
|
-
};
|
|
213
|
-
type GetStreamResult = {
|
|
214
|
-
error?: unknown;
|
|
215
|
-
replacedTracks?: MediaStreamTrack[];
|
|
216
|
-
stream: MediaStream;
|
|
217
|
-
};
|
|
218
|
-
type GetUpdatedDevicesResult = {
|
|
219
|
-
addedDevices: {
|
|
220
|
-
audioinput?: {
|
|
221
|
-
deviceId: string;
|
|
222
|
-
label: string;
|
|
223
|
-
kind: string;
|
|
224
|
-
};
|
|
225
|
-
videoinput?: {
|
|
226
|
-
deviceId: string;
|
|
227
|
-
label: string;
|
|
228
|
-
kind: string;
|
|
229
|
-
};
|
|
230
|
-
audiooutput?: {
|
|
231
|
-
deviceId: string;
|
|
232
|
-
label: string;
|
|
233
|
-
kind: string;
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
changedDevices: {
|
|
237
|
-
audioinput?: {
|
|
238
|
-
deviceId: string;
|
|
239
|
-
label: string;
|
|
240
|
-
kind: string;
|
|
241
|
-
};
|
|
242
|
-
videoinput?: {
|
|
243
|
-
deviceId: string;
|
|
244
|
-
label: string;
|
|
245
|
-
kind: string;
|
|
246
|
-
};
|
|
247
|
-
audiooutput?: {
|
|
248
|
-
deviceId: string;
|
|
249
|
-
label: string;
|
|
250
|
-
kind: string;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
type GetDeviceDataResult = {
|
|
255
|
-
audio: {
|
|
256
|
-
deviceId: string;
|
|
257
|
-
label: string;
|
|
258
|
-
kind: string;
|
|
259
|
-
};
|
|
260
|
-
video: {
|
|
261
|
-
deviceId: string;
|
|
262
|
-
label: string;
|
|
263
|
-
kind: string;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
interface CustomMediaStreamTrack extends MediaStreamTrack {
|
|
267
|
-
effectTrack?: boolean;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
declare function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, preferredDeviceIds, resolution, simulcast, widescreen, }: GetMediaConstraintsOptions): any;
|
|
271
|
-
declare function getConstraints({ devices, videoId, audioId, options, type }: GetConstraintsOptions): any;
|
|
272
|
-
|
|
273
|
-
declare const isMobile: boolean;
|
|
274
|
-
declare class NoDevicesError extends Error {
|
|
275
|
-
constructor(...args: any);
|
|
276
|
-
}
|
|
277
|
-
declare function enumerate(): Promise<MediaDeviceInfo[]>;
|
|
278
|
-
declare function buildDeviceList({ busyDeviceIds, devices, kind }: any): any;
|
|
279
|
-
declare function getUserMedia(constraints: any): Promise<MediaStream>;
|
|
280
|
-
declare function getDeviceData({ audioTrack, videoTrack, devices, stoppedVideoTrack, lastAudioId, lastVideoId, }: {
|
|
281
|
-
audioTrack?: MediaStreamTrack | null;
|
|
282
|
-
videoTrack?: MediaStreamTrack | null;
|
|
283
|
-
devices: MediaDeviceInfo[];
|
|
284
|
-
stoppedVideoTrack?: boolean;
|
|
285
|
-
lastAudioId?: string | undefined;
|
|
286
|
-
lastVideoId?: string | undefined;
|
|
287
|
-
}): GetDeviceDataResult;
|
|
288
|
-
declare function stopStreamTracks(stream: MediaStream, only?: "audio" | "video" | false): void;
|
|
289
|
-
declare function replaceTracksInStream(stream: MediaStream, newStream: MediaStream, only: "audio" | "video" | false): MediaStreamTrack[];
|
|
290
|
-
declare function getStream2(constraintOpt: GetConstraintsOptions, additionalOpts?: GetStreamOptions): Promise<GetStreamResult>;
|
|
291
|
-
declare function getStream(constraintOpt: any, { replaceStream, fallback }?: GetStreamOptions): Promise<GetStreamResult>;
|
|
292
|
-
declare function hasGetDisplayMedia(): boolean;
|
|
293
|
-
declare function getDisplayMedia(constraints?: {
|
|
294
|
-
video: {
|
|
295
|
-
width: {
|
|
296
|
-
max: number;
|
|
297
|
-
};
|
|
298
|
-
height: {
|
|
299
|
-
max: number;
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
}, contentHint?: string): Promise<MediaStream>;
|
|
303
|
-
declare function compareLocalDevices(before: any, after: any): any;
|
|
304
|
-
declare function getUpdatedDevices({ oldDevices, newDevices, currentAudioId, currentVideoId, currentSpeakerId, }: {
|
|
305
|
-
oldDevices: MediaDeviceInfo[];
|
|
306
|
-
newDevices: MediaDeviceInfo[];
|
|
307
|
-
currentAudioId?: string | undefined;
|
|
308
|
-
currentVideoId?: string | undefined;
|
|
309
|
-
currentSpeakerId?: string | undefined;
|
|
310
|
-
}): GetUpdatedDevicesResult;
|
|
311
|
-
|
|
312
|
-
declare class P2pRtcManager implements RtcManager {
|
|
313
|
-
_selfId: any;
|
|
314
|
-
_roomName: any;
|
|
315
|
-
_roomSessionId: any;
|
|
316
|
-
peerConnections: any;
|
|
317
|
-
localStreams: any;
|
|
318
|
-
enabledLocalStreamIds: any[];
|
|
319
|
-
_screenshareVideoTrackIds: any[];
|
|
320
|
-
_socketListenerDeregisterFunctions: any[];
|
|
321
|
-
_localStreamDeregisterFunction: any;
|
|
322
|
-
_emitter: any;
|
|
323
|
-
_serverSocket: any;
|
|
324
|
-
_webrtcProvider: any;
|
|
325
|
-
_features: any;
|
|
326
|
-
_isAudioOnlyMode: boolean;
|
|
327
|
-
offerOptions: {
|
|
328
|
-
offerToReceiveAudio: boolean;
|
|
329
|
-
offerToReceiveVideo: boolean;
|
|
330
|
-
};
|
|
331
|
-
_pendingActionsForConnectedPeerConnections: any[];
|
|
332
|
-
_audioTrackOnEnded: () => void;
|
|
333
|
-
_videoTrackOnEnded: () => void;
|
|
334
|
-
totalSessionsCreated: number;
|
|
335
|
-
_iceServers: any;
|
|
336
|
-
_sfuServer: any;
|
|
337
|
-
_mediaserverConfigTtlSeconds: any;
|
|
338
|
-
_fetchMediaServersTimer: any;
|
|
339
|
-
_wasScreenSharing: any;
|
|
340
|
-
ipv6HostCandidateTeredoSeen: any;
|
|
341
|
-
ipv6HostCandidate6to4Seen: any;
|
|
342
|
-
mdnsHostCandidateSeen: any;
|
|
343
|
-
_lastReverseDirectionAttemptByClientId: any;
|
|
344
|
-
_stoppedVideoTrack: any;
|
|
345
|
-
icePublicIPGatheringTimeoutID: any;
|
|
346
|
-
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
347
|
-
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
348
|
-
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
349
|
-
selfId: any;
|
|
350
|
-
room: any;
|
|
351
|
-
emitter: any;
|
|
352
|
-
serverSocket: any;
|
|
353
|
-
webrtcProvider: any;
|
|
354
|
-
features: any;
|
|
355
|
-
});
|
|
356
|
-
numberOfPeerconnections(): number;
|
|
357
|
-
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
358
|
-
selfId: any;
|
|
359
|
-
roomName: any;
|
|
360
|
-
isSfu: any;
|
|
361
|
-
}): boolean;
|
|
362
|
-
supportsScreenShareAudio(): boolean;
|
|
363
|
-
maybeRestrictRelayBandwidth(session: any): void;
|
|
364
|
-
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
365
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
366
|
-
accept({ clientId, shouldAddLocalVideo }: {
|
|
367
|
-
clientId: string;
|
|
368
|
-
shouldAddLocalVideo?: boolean;
|
|
369
|
-
}): any;
|
|
370
|
-
disconnectAll(): void;
|
|
371
|
-
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
372
|
-
setupSocketListeners(): void;
|
|
373
|
-
sendAudioMutedStats(muted: boolean): void;
|
|
374
|
-
sendVideoMutedStats(muted: boolean): void;
|
|
375
|
-
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
376
|
-
rtcStatsDisconnect(): void;
|
|
377
|
-
rtcStatsReconnect(): void;
|
|
378
|
-
setAudioOnly(audioOnly: any): void;
|
|
379
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
380
|
-
setRoomSessionId(roomSessionId: string): void;
|
|
381
|
-
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
382
|
-
_setJitterBufferTarget(pc: any): void;
|
|
383
|
-
_emitServerEvent(eventName: string, data?: any, callback?: any): void;
|
|
384
|
-
_emit(eventName: string, data?: any): void;
|
|
385
|
-
_addEnabledLocalStreamId(streamId: string): void;
|
|
386
|
-
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
387
|
-
_getSession(peerConnectionId: string): any;
|
|
388
|
-
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
389
|
-
_getLocalCameraStream(): any;
|
|
390
|
-
_getNonLocalCameraStreamIds(): string[];
|
|
391
|
-
_isScreensharingLocally(): boolean;
|
|
392
|
-
_getFirstLocalNonCameraStream(): any;
|
|
393
|
-
_transformIncomingSdp(original: any, _: any): {
|
|
394
|
-
type: any;
|
|
395
|
-
sdp: any;
|
|
396
|
-
};
|
|
397
|
-
_transformOutgoingSdp(original: any): {
|
|
398
|
-
type: any;
|
|
399
|
-
sdpU: any;
|
|
400
|
-
};
|
|
401
|
-
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
|
|
402
|
-
clientId: string;
|
|
403
|
-
initialBandwidth: any;
|
|
404
|
-
isOfferer: any;
|
|
405
|
-
peerConnectionId: string;
|
|
406
|
-
shouldAddLocalVideo: boolean;
|
|
407
|
-
}): any;
|
|
408
|
-
_cleanup(peerConnectionId: string): void;
|
|
409
|
-
_forEachPeerConnection(func: any): void;
|
|
410
|
-
_addStreamToPeerConnections(stream: any): void;
|
|
411
|
-
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
412
|
-
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
413
|
-
_removeStreamFromPeerConnections(stream: any): void;
|
|
414
|
-
_removeTrackFromPeerConnections(track: any): void;
|
|
415
|
-
_addLocalStream(streamId: string, stream: any): void;
|
|
416
|
-
_removeLocalStream(streamId: string): void;
|
|
417
|
-
_updateAndScheduleMediaServersRefresh({ iceServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
418
|
-
_clearMediaServersRefresh(): void;
|
|
419
|
-
_monitorAudioTrack(track: any): void;
|
|
420
|
-
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
421
|
-
_connect(clientId: string): Promise<any>;
|
|
422
|
-
_maybeRestartIce(clientId: string, session: any): void;
|
|
423
|
-
_setCodecPreferences(pc: any, vp9On: any, av1On: any, redOn: any): void;
|
|
424
|
-
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
425
|
-
_withForcedRenegotiation(session: any, action: any): void;
|
|
426
|
-
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
427
|
-
_createP2pSession(clientId: string, initialBandwidth: any, shouldAddLocalVideo: any, isOfferer?: any): any;
|
|
428
|
-
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
|
|
429
|
-
streamId: string;
|
|
430
|
-
clientId: string;
|
|
431
|
-
shouldAddLocalVideo?: boolean;
|
|
432
|
-
}): any;
|
|
433
|
-
disconnect(clientId: string): void;
|
|
434
|
-
updateStreamResolution(): void;
|
|
435
|
-
stopOrResumeAudio(): void;
|
|
436
|
-
_handleStopOrResumeVideo({ enable, track }: {
|
|
437
|
-
enable: boolean;
|
|
438
|
-
track: any;
|
|
439
|
-
}): void;
|
|
440
|
-
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
441
|
-
_shareScreen(streamId: string, stream: any): void;
|
|
442
|
-
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
443
|
-
hasClient(clientId: string): boolean;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
declare const assert: {
|
|
447
|
-
fail: (message?: string | Error) => void;
|
|
448
|
-
ok: (value: any, message?: string | Error) => void;
|
|
449
|
-
equal?: (actual: any, expected: any, message?: string | Error) => void;
|
|
450
|
-
notEqual?: (actual: any, expected: any, message?: string | Error) => void;
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
declare const createWorker: (fn: Function) => Worker;
|
|
454
|
-
declare const generateByteString: (count: number) => string;
|
|
455
|
-
|
|
456
|
-
declare const getHandler: () => mediasoup_client_lib_Device.BuiltinHandlerName | undefined;
|
|
457
|
-
|
|
458
|
-
declare const ipRegex: {
|
|
459
|
-
(options: {
|
|
460
|
-
exact: boolean;
|
|
461
|
-
includeBoundaries?: boolean;
|
|
462
|
-
}): RegExp;
|
|
463
|
-
v4(options: {
|
|
464
|
-
exact: boolean;
|
|
465
|
-
includeBoundaries?: boolean;
|
|
466
|
-
}): RegExp;
|
|
467
|
-
v6(options: {
|
|
468
|
-
exact: boolean;
|
|
469
|
-
includeBoundaries?: boolean;
|
|
470
|
-
}): RegExp;
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: any) => {
|
|
474
|
-
encodings: {}[];
|
|
475
|
-
};
|
|
476
|
-
declare const modifyMediaCapabilities: (routerRtpCapabilities: any, features: any) => void;
|
|
477
|
-
|
|
478
|
-
declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
|
|
479
|
-
|
|
480
|
-
declare class ReconnectManager extends EventEmitter {
|
|
481
|
-
_socket: any;
|
|
482
|
-
_clients: any;
|
|
483
|
-
_signalDisconnectTime?: number;
|
|
484
|
-
rtcManager?: RtcManager;
|
|
485
|
-
metrics: {
|
|
486
|
-
roomJoinedLate: number;
|
|
487
|
-
pendingClientCanceled: number;
|
|
488
|
-
evaluationFailed: number;
|
|
489
|
-
roomJoined: number;
|
|
490
|
-
};
|
|
491
|
-
constructor(socket: any);
|
|
492
|
-
_onRoomJoined(payload: any): Promise<void>;
|
|
493
|
-
_onClientLeft(payload: any): void;
|
|
494
|
-
_onPendingClientLeft(payload: any): void;
|
|
495
|
-
_onNewClient(payload: any): void;
|
|
496
|
-
_abortIfNotActive(payload: any): Promise<void>;
|
|
497
|
-
_checkIsActive(clientId: string): Promise<boolean>;
|
|
498
|
-
_isClientMediaActive(stats: any, clientId: string): boolean;
|
|
499
|
-
_onAudioEnabled(payload: any): void;
|
|
500
|
-
_onVideoEnabled(payload: any): void;
|
|
501
|
-
_onScreenshareChanged(payload: any, action: boolean): void;
|
|
502
|
-
_hasClientStateChanged({ clientId, webcam, mic, screenShare, }: {
|
|
503
|
-
clientId: string;
|
|
504
|
-
webcam: boolean;
|
|
505
|
-
mic: boolean;
|
|
506
|
-
screenShare: boolean;
|
|
507
|
-
}): boolean;
|
|
508
|
-
_addClientToState(newClient: any): void;
|
|
509
|
-
_wasClientSendingMedia(clientId: string): any;
|
|
510
|
-
_getPendingClientsByDeviceId(deviceId: string): unknown[];
|
|
511
|
-
_resetClientState(payload: any): void;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
declare class ServerSocket {
|
|
515
|
-
_socket: any;
|
|
516
|
-
_reconnectManager?: ReconnectManager | null;
|
|
517
|
-
noopKeepaliveInterval: any;
|
|
518
|
-
_wasConnectedUsingWebsocket?: boolean;
|
|
519
|
-
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean);
|
|
520
|
-
setRtcManager(rtcManager?: RtcManager): void;
|
|
521
|
-
connect(): void;
|
|
522
|
-
disconnect(): void;
|
|
523
|
-
disconnectOnConnect(): void;
|
|
524
|
-
emit(eventName: string, ...args: any[]): void;
|
|
525
|
-
emitIfConnected(eventName: string, data: any): void;
|
|
526
|
-
getTransport(): any;
|
|
527
|
-
getManager(): any;
|
|
528
|
-
isConnecting(): any;
|
|
529
|
-
isConnected(): any;
|
|
530
|
-
on(eventName: string, handler: Function): () => void;
|
|
531
|
-
once(eventName: string, handler: Function): void;
|
|
532
|
-
off(eventName: string, handler: Function): void;
|
|
533
|
-
_interceptEvent(eventName: string, handler: any): () => void;
|
|
534
|
-
getGlitchFreeMetrics(): {
|
|
535
|
-
roomJoinedLate: number;
|
|
536
|
-
pendingClientCanceled: number;
|
|
537
|
-
evaluationFailed: number;
|
|
538
|
-
roomJoined: number;
|
|
539
|
-
} | undefined;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
declare const maybeTurnOnly: (transportConfig: any, features: {
|
|
543
|
-
useOnlyTURN: string;
|
|
544
|
-
}) => void;
|
|
545
|
-
|
|
546
|
-
interface Credentials {
|
|
547
|
-
credentials: {
|
|
548
|
-
uuid: string;
|
|
549
|
-
};
|
|
550
|
-
hmac: string;
|
|
551
|
-
userId: string;
|
|
552
|
-
}
|
|
553
|
-
interface SocketConf {
|
|
554
|
-
host?: string;
|
|
555
|
-
path?: string;
|
|
556
|
-
reconnectionDelay?: number;
|
|
557
|
-
reconnectionDelayMax?: number;
|
|
558
|
-
timeout?: number;
|
|
559
|
-
autoConnect?: boolean;
|
|
560
|
-
}
|
|
561
|
-
interface SocketManager {
|
|
562
|
-
on: (eventName: string, callback: (args: unknown) => void) => void;
|
|
563
|
-
}
|
|
564
|
-
type RoleName = "none" | "visitor" | "granted_visitor" | "viewer" | "granted_viewer" | "host" | "recorder" | "streamer";
|
|
565
|
-
interface ClientRole {
|
|
566
|
-
roleName: RoleName;
|
|
567
|
-
}
|
|
568
|
-
interface SignalKnocker {
|
|
569
|
-
clientId: string;
|
|
570
|
-
displayName: string | null;
|
|
571
|
-
imageUrl: string | null;
|
|
572
|
-
liveVideo: boolean;
|
|
573
|
-
userAvatarUrl: string | null;
|
|
574
|
-
userId: string | null;
|
|
575
|
-
}
|
|
576
|
-
interface SignalClient {
|
|
577
|
-
displayName: string;
|
|
578
|
-
id: string;
|
|
579
|
-
streams: string[];
|
|
580
|
-
isAudioEnabled: boolean;
|
|
581
|
-
isVideoEnabled: boolean;
|
|
582
|
-
role: ClientRole;
|
|
583
|
-
startedCloudRecordingAt: string | null;
|
|
584
|
-
externalId: string | null;
|
|
585
|
-
isDialIn: boolean;
|
|
586
|
-
}
|
|
587
|
-
interface Spotlight {
|
|
588
|
-
clientId: string;
|
|
589
|
-
streamId: string;
|
|
590
|
-
}
|
|
591
|
-
interface AudioEnabledEvent {
|
|
592
|
-
clientId: string;
|
|
593
|
-
isAudioEnabled: boolean;
|
|
594
|
-
}
|
|
595
|
-
interface ChatMessage {
|
|
596
|
-
id: string;
|
|
597
|
-
messageType: "text";
|
|
598
|
-
roomName: string;
|
|
599
|
-
senderId: string;
|
|
600
|
-
sig: string;
|
|
601
|
-
text: string;
|
|
602
|
-
timestamp: string;
|
|
603
|
-
userId: string;
|
|
604
|
-
}
|
|
605
|
-
interface CloudRecordingStartedEvent {
|
|
606
|
-
error?: string;
|
|
607
|
-
startedAt?: string;
|
|
608
|
-
}
|
|
609
|
-
interface ClientLeftEvent {
|
|
610
|
-
clientId: string;
|
|
611
|
-
}
|
|
612
|
-
interface NewClientEvent {
|
|
613
|
-
client: SignalClient;
|
|
614
|
-
room?: {
|
|
615
|
-
session: {
|
|
616
|
-
createdAt: string;
|
|
617
|
-
id: string;
|
|
618
|
-
} | null;
|
|
266
|
+
interface ChatMessage {
|
|
267
|
+
id: string;
|
|
268
|
+
messageType: "text";
|
|
269
|
+
roomName: string;
|
|
270
|
+
senderId: string;
|
|
271
|
+
sig: string;
|
|
272
|
+
text: string;
|
|
273
|
+
timestamp: string;
|
|
274
|
+
userId: string;
|
|
275
|
+
}
|
|
276
|
+
interface CloudRecordingStartedEvent {
|
|
277
|
+
error?: string;
|
|
278
|
+
startedAt?: string;
|
|
279
|
+
}
|
|
280
|
+
interface ClientLeftEvent {
|
|
281
|
+
clientId: string;
|
|
282
|
+
}
|
|
283
|
+
interface NewClientEvent {
|
|
284
|
+
client: SignalClient;
|
|
285
|
+
room?: {
|
|
286
|
+
session: {
|
|
287
|
+
createdAt: string;
|
|
288
|
+
id: string;
|
|
289
|
+
} | null;
|
|
619
290
|
};
|
|
620
291
|
}
|
|
621
292
|
interface ClientKickedEvent {
|
|
@@ -791,51 +462,387 @@ interface SignalRequests {
|
|
|
791
462
|
chat_message: {
|
|
792
463
|
text: string;
|
|
793
464
|
};
|
|
794
|
-
enable_audio: {
|
|
795
|
-
enabled: boolean;
|
|
465
|
+
enable_audio: {
|
|
466
|
+
enabled: boolean;
|
|
467
|
+
};
|
|
468
|
+
enable_video: {
|
|
469
|
+
enabled: boolean;
|
|
470
|
+
};
|
|
471
|
+
handle_knock: {
|
|
472
|
+
action: "accept" | "reject";
|
|
473
|
+
clientId: string;
|
|
474
|
+
response: unknown;
|
|
475
|
+
};
|
|
476
|
+
identify_device: IdentifyDeviceRequest;
|
|
477
|
+
join_room: JoinRoomRequest;
|
|
478
|
+
knock_room: KnockRoomRequest;
|
|
479
|
+
leave_room: void;
|
|
480
|
+
remove_spotlight: RemoveSpotlightRequest;
|
|
481
|
+
request_audio_enable: AudioEnableRequest;
|
|
482
|
+
send_client_metadata: {
|
|
483
|
+
type: string;
|
|
484
|
+
payload: {
|
|
485
|
+
displayName?: string;
|
|
486
|
+
stickyReaction?: unknown;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
set_lock: {
|
|
490
|
+
locked: boolean;
|
|
491
|
+
};
|
|
492
|
+
start_recording: {
|
|
493
|
+
recording: string;
|
|
494
|
+
};
|
|
495
|
+
stop_recording: void;
|
|
496
|
+
}
|
|
497
|
+
type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
|
|
498
|
+
|
|
499
|
+
declare function fromLocation({ host, protocol }?: {
|
|
500
|
+
host?: string | undefined;
|
|
501
|
+
protocol?: string | undefined;
|
|
502
|
+
}): {
|
|
503
|
+
domain: string;
|
|
504
|
+
domainWithSeparator: string;
|
|
505
|
+
organizationDomain: string;
|
|
506
|
+
organization: string;
|
|
507
|
+
service: string;
|
|
508
|
+
subdomain: string;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
declare enum RtcEventNames {
|
|
512
|
+
rtc_manager_created = "rtc_manager_created",
|
|
513
|
+
stream_added = "stream_added"
|
|
514
|
+
}
|
|
515
|
+
interface RtcManager {
|
|
516
|
+
acceptNewStream: ({ activeBreakout, clientId, shouldAddLocalVideo, streamId, enforceTurnProtocol }: {
|
|
517
|
+
activeBreakout: boolean;
|
|
518
|
+
clientId: string;
|
|
519
|
+
shouldAddLocalVideo: boolean;
|
|
520
|
+
streamId: string;
|
|
521
|
+
enforceTurnProtocol?: TurnTransportProtocol;
|
|
522
|
+
}) => void;
|
|
523
|
+
addNewStream(streamId: string, stream: MediaStream, isAudioEnabled: boolean, isVideoEnabled: boolean): void;
|
|
524
|
+
disconnect(streamId: string, activeBreakout: boolean | null, eventClaim?: string): void;
|
|
525
|
+
disconnectAll(): void;
|
|
526
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack, newTrack: CustomMediaStreamTrack): void;
|
|
527
|
+
removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string | null): void;
|
|
528
|
+
shouldAcceptStreamsFromBothSides?: () => boolean;
|
|
529
|
+
updateStreamResolution(streamId: string, ignored: null, resolution: {
|
|
530
|
+
width: number;
|
|
531
|
+
height: number;
|
|
532
|
+
}): void;
|
|
533
|
+
sendStatsCustomEvent(eventName: string, data: unknown): void;
|
|
534
|
+
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
535
|
+
selfId: string;
|
|
536
|
+
roomName: string;
|
|
537
|
+
isSfu: boolean;
|
|
538
|
+
}): boolean;
|
|
539
|
+
setEventClaim?(eventClaim: string): void;
|
|
540
|
+
hasClient(clientId: string): boolean;
|
|
541
|
+
}
|
|
542
|
+
interface RtcManagerCreatedPayload {
|
|
543
|
+
rtcManager: RtcManager;
|
|
544
|
+
}
|
|
545
|
+
interface RtcStreamAddedPayload {
|
|
546
|
+
clientId: string;
|
|
547
|
+
stream: MediaStream;
|
|
548
|
+
streamId: string | undefined;
|
|
549
|
+
streamType: "webcam" | "screenshare" | undefined;
|
|
550
|
+
}
|
|
551
|
+
interface RtcClientConnectionStatusChangedPayload {
|
|
552
|
+
streamIds: string[];
|
|
553
|
+
clientId: string;
|
|
554
|
+
status: string;
|
|
555
|
+
previous: string;
|
|
556
|
+
}
|
|
557
|
+
interface RtcLocalStreamTrackAddedPayload {
|
|
558
|
+
streamId: string;
|
|
559
|
+
tracks: MediaStreamTrack[];
|
|
560
|
+
screenShare: boolean;
|
|
561
|
+
}
|
|
562
|
+
interface RtcLocalStreamTrackRemovedPayload {
|
|
563
|
+
stream: MediaStream;
|
|
564
|
+
track: MediaStreamTrack;
|
|
565
|
+
}
|
|
566
|
+
type RtcEvents = {
|
|
567
|
+
client_connection_status_changed: RtcClientConnectionStatusChangedPayload;
|
|
568
|
+
stream_added: RtcStreamAddedPayload;
|
|
569
|
+
rtc_manager_created: RtcManagerCreatedPayload;
|
|
570
|
+
rtc_manager_destroyed: void;
|
|
571
|
+
local_stream_track_added: RtcLocalStreamTrackAddedPayload;
|
|
572
|
+
local_stream_track_removed: RtcLocalStreamTrackRemovedPayload;
|
|
573
|
+
remote_stream_track_added: void;
|
|
574
|
+
remote_stream_track_removed: void;
|
|
575
|
+
};
|
|
576
|
+
type GetMediaConstraintsOptions = {
|
|
577
|
+
disableAEC: boolean;
|
|
578
|
+
disableAGC: boolean;
|
|
579
|
+
hd: boolean;
|
|
580
|
+
lax: boolean;
|
|
581
|
+
lowDataMode: boolean;
|
|
582
|
+
preferredDeviceIds: {
|
|
583
|
+
audioId?: boolean | string | null | {
|
|
584
|
+
ideal?: string | null;
|
|
585
|
+
exact?: string | null;
|
|
586
|
+
};
|
|
587
|
+
videoId?: boolean | string | null | {
|
|
588
|
+
ideal?: string | null;
|
|
589
|
+
exact?: string | null;
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
resolution?: string;
|
|
593
|
+
simulcast: boolean;
|
|
594
|
+
widescreen: boolean;
|
|
595
|
+
usingAspectRatio16x9: boolean;
|
|
596
|
+
};
|
|
597
|
+
type GetConstraintsOptions = {
|
|
598
|
+
devices: MediaDeviceInfo[];
|
|
599
|
+
audioId?: boolean | string;
|
|
600
|
+
videoId?: boolean | string;
|
|
601
|
+
type?: "ideal" | "exact";
|
|
602
|
+
options: Omit<GetMediaConstraintsOptions, "preferredDeviceIds">;
|
|
603
|
+
};
|
|
604
|
+
type GetStreamOptions = {
|
|
605
|
+
replaceStream?: MediaStream;
|
|
606
|
+
fallback?: boolean;
|
|
607
|
+
};
|
|
608
|
+
type GetStreamResult = {
|
|
609
|
+
error?: unknown;
|
|
610
|
+
replacedTracks?: MediaStreamTrack[];
|
|
611
|
+
stream: MediaStream;
|
|
612
|
+
};
|
|
613
|
+
type GetUpdatedDevicesResult = {
|
|
614
|
+
addedDevices: {
|
|
615
|
+
audioinput?: {
|
|
616
|
+
deviceId: string;
|
|
617
|
+
label: string;
|
|
618
|
+
kind: string;
|
|
619
|
+
};
|
|
620
|
+
videoinput?: {
|
|
621
|
+
deviceId: string;
|
|
622
|
+
label: string;
|
|
623
|
+
kind: string;
|
|
624
|
+
};
|
|
625
|
+
audiooutput?: {
|
|
626
|
+
deviceId: string;
|
|
627
|
+
label: string;
|
|
628
|
+
kind: string;
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
changedDevices: {
|
|
632
|
+
audioinput?: {
|
|
633
|
+
deviceId: string;
|
|
634
|
+
label: string;
|
|
635
|
+
kind: string;
|
|
636
|
+
};
|
|
637
|
+
videoinput?: {
|
|
638
|
+
deviceId: string;
|
|
639
|
+
label: string;
|
|
640
|
+
kind: string;
|
|
641
|
+
};
|
|
642
|
+
audiooutput?: {
|
|
643
|
+
deviceId: string;
|
|
644
|
+
label: string;
|
|
645
|
+
kind: string;
|
|
646
|
+
};
|
|
796
647
|
};
|
|
797
|
-
|
|
798
|
-
|
|
648
|
+
};
|
|
649
|
+
type GetDeviceDataResult = {
|
|
650
|
+
audio: {
|
|
651
|
+
deviceId: string;
|
|
652
|
+
label: string;
|
|
653
|
+
kind: string;
|
|
799
654
|
};
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
655
|
+
video: {
|
|
656
|
+
deviceId: string;
|
|
657
|
+
label: string;
|
|
658
|
+
kind: string;
|
|
804
659
|
};
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
660
|
+
};
|
|
661
|
+
interface CustomMediaStreamTrack extends MediaStreamTrack {
|
|
662
|
+
effectTrack?: boolean;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
declare function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, preferredDeviceIds, resolution, simulcast, widescreen, }: GetMediaConstraintsOptions): any;
|
|
666
|
+
declare function getConstraints({ devices, videoId, audioId, options, type }: GetConstraintsOptions): any;
|
|
667
|
+
|
|
668
|
+
declare const isMobile: boolean;
|
|
669
|
+
declare class NoDevicesError extends Error {
|
|
670
|
+
constructor(...args: any);
|
|
671
|
+
}
|
|
672
|
+
declare function enumerate(): Promise<MediaDeviceInfo[]>;
|
|
673
|
+
declare function buildDeviceList({ busyDeviceIds, devices, kind }: any): any;
|
|
674
|
+
declare function getUserMedia(constraints: any): Promise<MediaStream>;
|
|
675
|
+
declare function getDeviceData({ audioTrack, videoTrack, devices, stoppedVideoTrack, lastAudioId, lastVideoId, }: {
|
|
676
|
+
audioTrack?: MediaStreamTrack | null;
|
|
677
|
+
videoTrack?: MediaStreamTrack | null;
|
|
678
|
+
devices: MediaDeviceInfo[];
|
|
679
|
+
stoppedVideoTrack?: boolean;
|
|
680
|
+
lastAudioId?: string | undefined;
|
|
681
|
+
lastVideoId?: string | undefined;
|
|
682
|
+
}): GetDeviceDataResult;
|
|
683
|
+
declare function stopStreamTracks(stream: MediaStream, only?: "audio" | "video" | false): void;
|
|
684
|
+
declare function replaceTracksInStream(stream: MediaStream, newStream: MediaStream, only: "audio" | "video" | false): MediaStreamTrack[];
|
|
685
|
+
declare function getStream2(constraintOpt: GetConstraintsOptions, additionalOpts?: GetStreamOptions): Promise<GetStreamResult>;
|
|
686
|
+
declare function getStream(constraintOpt: any, { replaceStream, fallback }?: GetStreamOptions): Promise<GetStreamResult>;
|
|
687
|
+
declare function hasGetDisplayMedia(): boolean;
|
|
688
|
+
declare function getDisplayMedia(constraints?: {
|
|
689
|
+
video: {
|
|
690
|
+
width: {
|
|
691
|
+
max: number;
|
|
692
|
+
};
|
|
693
|
+
height: {
|
|
694
|
+
max: number;
|
|
816
695
|
};
|
|
817
696
|
};
|
|
818
|
-
|
|
819
|
-
|
|
697
|
+
}, contentHint?: string): Promise<MediaStream>;
|
|
698
|
+
declare function compareLocalDevices(before: any, after: any): any;
|
|
699
|
+
declare function getUpdatedDevices({ oldDevices, newDevices, currentAudioId, currentVideoId, currentSpeakerId, }: {
|
|
700
|
+
oldDevices: MediaDeviceInfo[];
|
|
701
|
+
newDevices: MediaDeviceInfo[];
|
|
702
|
+
currentAudioId?: string | undefined;
|
|
703
|
+
currentVideoId?: string | undefined;
|
|
704
|
+
currentSpeakerId?: string | undefined;
|
|
705
|
+
}): GetUpdatedDevicesResult;
|
|
706
|
+
|
|
707
|
+
declare class P2pRtcManager implements RtcManager {
|
|
708
|
+
_selfId: any;
|
|
709
|
+
_roomName: any;
|
|
710
|
+
_roomSessionId: any;
|
|
711
|
+
peerConnections: any;
|
|
712
|
+
localStreams: any;
|
|
713
|
+
enabledLocalStreamIds: any[];
|
|
714
|
+
_screenshareVideoTrackIds: any[];
|
|
715
|
+
_socketListenerDeregisterFunctions: any[];
|
|
716
|
+
_localStreamDeregisterFunction: any;
|
|
717
|
+
_emitter: any;
|
|
718
|
+
_serverSocket: any;
|
|
719
|
+
_webrtcProvider: any;
|
|
720
|
+
_features: any;
|
|
721
|
+
_isAudioOnlyMode: boolean;
|
|
722
|
+
offerOptions: {
|
|
723
|
+
offerToReceiveAudio: boolean;
|
|
724
|
+
offerToReceiveVideo: boolean;
|
|
820
725
|
};
|
|
821
|
-
|
|
822
|
-
|
|
726
|
+
_pendingActionsForConnectedPeerConnections: any[];
|
|
727
|
+
_audioTrackOnEnded: () => void;
|
|
728
|
+
_videoTrackOnEnded: () => void;
|
|
729
|
+
totalSessionsCreated: number;
|
|
730
|
+
_iceServers: any;
|
|
731
|
+
_sfuServer: any;
|
|
732
|
+
_mediaserverConfigTtlSeconds: any;
|
|
733
|
+
_fetchMediaServersTimer: any;
|
|
734
|
+
_wasScreenSharing: any;
|
|
735
|
+
ipv6HostCandidateTeredoSeen: any;
|
|
736
|
+
ipv6HostCandidate6to4Seen: any;
|
|
737
|
+
mdnsHostCandidateSeen: any;
|
|
738
|
+
_lastReverseDirectionAttemptByClientId: any;
|
|
739
|
+
_stoppedVideoTrack: any;
|
|
740
|
+
icePublicIPGatheringTimeoutID: any;
|
|
741
|
+
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
742
|
+
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
743
|
+
_nodeJsClients: string[];
|
|
744
|
+
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
745
|
+
selfId: any;
|
|
746
|
+
room: any;
|
|
747
|
+
emitter: any;
|
|
748
|
+
serverSocket: any;
|
|
749
|
+
webrtcProvider: any;
|
|
750
|
+
features: any;
|
|
751
|
+
});
|
|
752
|
+
numberOfPeerconnections(): number;
|
|
753
|
+
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
754
|
+
selfId: any;
|
|
755
|
+
roomName: any;
|
|
756
|
+
isSfu: any;
|
|
757
|
+
}): boolean;
|
|
758
|
+
supportsScreenShareAudio(): boolean;
|
|
759
|
+
maybeRestrictRelayBandwidth(session: any): void;
|
|
760
|
+
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
761
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
762
|
+
disconnectAll(): void;
|
|
763
|
+
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
764
|
+
setupSocketListeners(): void;
|
|
765
|
+
sendAudioMutedStats(muted: boolean): void;
|
|
766
|
+
sendVideoMutedStats(muted: boolean): void;
|
|
767
|
+
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
768
|
+
rtcStatsDisconnect(): void;
|
|
769
|
+
rtcStatsReconnect(): void;
|
|
770
|
+
setAudioOnly(audioOnly: any): void;
|
|
771
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
772
|
+
setRoomSessionId(roomSessionId: string): void;
|
|
773
|
+
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
774
|
+
_setJitterBufferTarget(pc: any): void;
|
|
775
|
+
_emitServerEvent(eventName: string, data?: any, callback?: any): void;
|
|
776
|
+
_emit(eventName: string, data?: any): void;
|
|
777
|
+
_addEnabledLocalStreamId(streamId: string): void;
|
|
778
|
+
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
779
|
+
_getSession(peerConnectionId: string): any;
|
|
780
|
+
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
781
|
+
_getLocalCameraStream(): any;
|
|
782
|
+
_getNonLocalCameraStreamIds(): string[];
|
|
783
|
+
_isScreensharingLocally(): boolean;
|
|
784
|
+
_getFirstLocalNonCameraStream(): any;
|
|
785
|
+
_transformIncomingSdp(original: any, _: any): {
|
|
786
|
+
type: any;
|
|
787
|
+
sdp: any;
|
|
823
788
|
};
|
|
824
|
-
|
|
789
|
+
_transformOutgoingSdp(original: any): {
|
|
790
|
+
type: any;
|
|
791
|
+
sdpU: any;
|
|
792
|
+
};
|
|
793
|
+
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, enforceTurnProtocol, }: {
|
|
794
|
+
clientId: string;
|
|
795
|
+
initialBandwidth: any;
|
|
796
|
+
isOfferer: any;
|
|
797
|
+
peerConnectionId: string;
|
|
798
|
+
shouldAddLocalVideo: boolean;
|
|
799
|
+
enforceTurnProtocol?: TurnTransportProtocol;
|
|
800
|
+
}): any;
|
|
801
|
+
_cleanup(peerConnectionId: string): void;
|
|
802
|
+
_forEachPeerConnection(func: any): void;
|
|
803
|
+
_addStreamToPeerConnections(stream: any): void;
|
|
804
|
+
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
805
|
+
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
806
|
+
_removeStreamFromPeerConnections(stream: any): void;
|
|
807
|
+
_removeTrackFromPeerConnections(track: any): void;
|
|
808
|
+
_addLocalStream(streamId: string, stream: any): void;
|
|
809
|
+
_removeLocalStream(streamId: string): void;
|
|
810
|
+
_updateAndScheduleMediaServersRefresh({ iceServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
811
|
+
_clearMediaServersRefresh(): void;
|
|
812
|
+
_monitorAudioTrack(track: any): void;
|
|
813
|
+
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
814
|
+
_connect(clientId: string): Promise<any>;
|
|
815
|
+
_maybeRestartIce(clientId: string, session: any): void;
|
|
816
|
+
_setCodecPreferences(pc: any, vp9On: any, av1On: any, redOn: any): void;
|
|
817
|
+
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
818
|
+
_withForcedRenegotiation(session: any, action: any): void;
|
|
819
|
+
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
820
|
+
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, enforceTurnProtocol, }: {
|
|
821
|
+
clientId: string;
|
|
822
|
+
initialBandwidth: number;
|
|
823
|
+
shouldAddLocalVideo: boolean;
|
|
824
|
+
isOfferer: boolean;
|
|
825
|
+
enforceTurnProtocol?: TurnTransportProtocol;
|
|
826
|
+
}): any;
|
|
827
|
+
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, enforceTurnProtocol, }: {
|
|
828
|
+
streamId: string;
|
|
829
|
+
clientId: string;
|
|
830
|
+
shouldAddLocalVideo?: boolean;
|
|
831
|
+
enforceTurnProtocol?: TurnTransportProtocol;
|
|
832
|
+
}): any;
|
|
833
|
+
disconnect(clientId: string): void;
|
|
834
|
+
updateStreamResolution(): void;
|
|
835
|
+
stopOrResumeAudio(): void;
|
|
836
|
+
_handleStopOrResumeVideo({ enable, track }: {
|
|
837
|
+
enable: boolean;
|
|
838
|
+
track: any;
|
|
839
|
+
}): void;
|
|
840
|
+
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
841
|
+
_shareScreen(streamId: string, stream: any): void;
|
|
842
|
+
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
843
|
+
hasClient(clientId: string): boolean;
|
|
825
844
|
}
|
|
826
845
|
|
|
827
|
-
declare function fromLocation({ host, protocol }?: {
|
|
828
|
-
host?: string | undefined;
|
|
829
|
-
protocol?: string | undefined;
|
|
830
|
-
}): {
|
|
831
|
-
domain: string;
|
|
832
|
-
domainWithSeparator: string;
|
|
833
|
-
organizationDomain: string;
|
|
834
|
-
organization: string;
|
|
835
|
-
service: string;
|
|
836
|
-
subdomain: string;
|
|
837
|
-
};
|
|
838
|
-
|
|
839
846
|
declare class RtcManagerDispatcher {
|
|
840
847
|
emitter: {
|
|
841
848
|
emit: <K extends keyof RtcEvents>(eventName: K, args?: RtcEvents[K]) => void;
|
|
@@ -1410,4 +1417,4 @@ declare class RtcStream {
|
|
|
1410
1417
|
static getTypeFromId(id: string): string;
|
|
1411
1418
|
}
|
|
1412
1419
|
|
|
1413
|
-
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
|
1420
|
+
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|