@whereby.com/media 1.14.1 → 1.15.0
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 +16 -26
- package/dist/index.d.cts +576 -581
- package/dist/index.d.mts +576 -581
- package/dist/index.d.ts +576 -581
- package/dist/index.mjs +16 -26
- package/dist/legacy-esm.js +16 -26
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -182,203 +182,535 @@ declare const MAXIMUM_TURN_BANDWIDTH = 1280;
|
|
|
182
182
|
declare const MAXIMUM_TURN_BANDWIDTH_UNLIMITED = -1;
|
|
183
183
|
declare const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
184
184
|
|
|
185
|
-
declare
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
declare const createWorker: (fn: Function) => Worker;
|
|
193
|
-
declare const generateByteString: (count: number) => string;
|
|
194
|
-
|
|
195
|
-
declare const getHandler: () => mediasoup_client_lib_Device.BuiltinHandlerName | undefined;
|
|
196
|
-
|
|
197
|
-
declare const ipRegex: {
|
|
198
|
-
(options: {
|
|
199
|
-
exact: boolean;
|
|
200
|
-
includeBoundaries?: boolean;
|
|
201
|
-
}): RegExp;
|
|
202
|
-
v4(options: {
|
|
203
|
-
exact: boolean;
|
|
204
|
-
includeBoundaries?: boolean;
|
|
205
|
-
}): RegExp;
|
|
206
|
-
v6(options: {
|
|
207
|
-
exact: boolean;
|
|
208
|
-
includeBoundaries?: boolean;
|
|
209
|
-
}): RegExp;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: any) => {
|
|
213
|
-
encodings: {}[];
|
|
214
|
-
};
|
|
215
|
-
declare const modifyMediaCapabilities: (routerRtpCapabilities: any, features: any) => void;
|
|
216
|
-
|
|
217
|
-
declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
|
|
218
|
-
|
|
219
|
-
declare class ReconnectManager extends EventEmitter {
|
|
220
|
-
_socket: any;
|
|
221
|
-
_clients: any;
|
|
222
|
-
_signalDisconnectTime?: number;
|
|
223
|
-
rtcManager?: RtcManager;
|
|
224
|
-
metrics: {
|
|
225
|
-
roomJoinedLate: number;
|
|
226
|
-
pendingClientCanceled: number;
|
|
227
|
-
evaluationFailed: number;
|
|
228
|
-
roomJoined: number;
|
|
229
|
-
};
|
|
230
|
-
reconnectThresholdInMs: number;
|
|
231
|
-
constructor(socket: any);
|
|
232
|
-
_onRoomJoined(payload: any): Promise<void>;
|
|
233
|
-
_onClientLeft(payload: any): void;
|
|
234
|
-
_onPendingClientLeft(payload: any): void;
|
|
235
|
-
_onNewClient(payload: any): void;
|
|
236
|
-
_abortIfNotActive(payload: any): Promise<void>;
|
|
237
|
-
_checkIsActive(clientId: string): Promise<boolean>;
|
|
238
|
-
_isClientMediaActive(stats: any, clientId: string): boolean;
|
|
239
|
-
_onAudioEnabled(payload: any): void;
|
|
240
|
-
_onVideoEnabled(payload: any): void;
|
|
241
|
-
_onScreenshareChanged(payload: any, action: boolean): void;
|
|
242
|
-
_hasClientStateChanged({ clientId, webcam, mic, screenShare, }: {
|
|
185
|
+
declare enum RtcEventNames {
|
|
186
|
+
rtc_manager_created = "rtc_manager_created",
|
|
187
|
+
stream_added = "stream_added"
|
|
188
|
+
}
|
|
189
|
+
interface RtcManager {
|
|
190
|
+
acceptNewStream: ({ activeBreakout, clientId, shouldAddLocalVideo, streamId, }: {
|
|
191
|
+
activeBreakout: boolean;
|
|
243
192
|
clientId: string;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
193
|
+
shouldAddLocalVideo: boolean;
|
|
194
|
+
streamId: string;
|
|
195
|
+
}) => void;
|
|
196
|
+
addNewStream(streamId: string, stream: MediaStream, isAudioEnabled: boolean, isVideoEnabled: boolean): void;
|
|
197
|
+
disconnect(streamId: string, activeBreakout: boolean | null, eventClaim?: string): void;
|
|
198
|
+
disconnectAll(): void;
|
|
199
|
+
rtcStatsDisconnect(): void;
|
|
200
|
+
rtcStatsReconnect(): void;
|
|
201
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack, newTrack: CustomMediaStreamTrack): void;
|
|
202
|
+
removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string | null): void;
|
|
203
|
+
shouldAcceptStreamsFromBothSides?: () => boolean;
|
|
204
|
+
updateStreamResolution(streamId: string, ignored: null, resolution: {
|
|
205
|
+
width: number;
|
|
206
|
+
height: number;
|
|
207
|
+
}): void;
|
|
208
|
+
sendStatsCustomEvent(eventName: string, data: unknown): void;
|
|
209
|
+
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
210
|
+
selfId: string;
|
|
211
|
+
roomName: string;
|
|
212
|
+
isSfu: boolean;
|
|
247
213
|
}): boolean;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
_getPendingClientsByDeviceId(deviceId: string): unknown[];
|
|
251
|
-
_resetClientState(payload: any): void;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
declare class ServerSocket {
|
|
255
|
-
_socket: any;
|
|
256
|
-
_reconnectManager?: ReconnectManager | null;
|
|
257
|
-
noopKeepaliveInterval: any;
|
|
258
|
-
_wasConnectedUsingWebsocket?: boolean;
|
|
259
|
-
disconnectTimestamp: number | undefined;
|
|
260
|
-
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean);
|
|
261
|
-
setRtcManager(rtcManager?: RtcManager): void;
|
|
262
|
-
connect(): void;
|
|
263
|
-
disconnect(): void;
|
|
264
|
-
disconnectOnConnect(): void;
|
|
265
|
-
emit(eventName: string, ...args: any[]): void;
|
|
266
|
-
emitIfConnected(eventName: string, data: any): void;
|
|
267
|
-
getTransport(): any;
|
|
268
|
-
getManager(): any;
|
|
269
|
-
isConnecting(): any;
|
|
270
|
-
isConnected(): any;
|
|
271
|
-
on(eventName: string, handler: Function): () => void;
|
|
272
|
-
once(eventName: string, handler: Function): void;
|
|
273
|
-
off(eventName: string, handler: Function): void;
|
|
274
|
-
_interceptEvent(eventName: string, handler: any): () => void;
|
|
275
|
-
getGlitchFreeMetrics(): {
|
|
276
|
-
roomJoinedLate: number;
|
|
277
|
-
pendingClientCanceled: number;
|
|
278
|
-
evaluationFailed: number;
|
|
279
|
-
roomJoined: number;
|
|
280
|
-
} | undefined;
|
|
281
|
-
getReconnectThreshold(): number | undefined;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
declare const maybeTurnOnly: (transportConfig: any, features: {
|
|
285
|
-
useOnlyTURN: string;
|
|
286
|
-
}) => void;
|
|
287
|
-
|
|
288
|
-
interface Credentials {
|
|
289
|
-
credentials: {
|
|
290
|
-
uuid: string;
|
|
291
|
-
};
|
|
292
|
-
hmac: string;
|
|
293
|
-
userId: string;
|
|
294
|
-
}
|
|
295
|
-
interface SocketConf {
|
|
296
|
-
host?: string;
|
|
297
|
-
path?: string;
|
|
298
|
-
reconnectionDelay?: number;
|
|
299
|
-
reconnectionDelayMax?: number;
|
|
300
|
-
timeout?: number;
|
|
301
|
-
autoConnect?: boolean;
|
|
302
|
-
}
|
|
303
|
-
interface SocketManager {
|
|
304
|
-
on: (eventName: string, callback: (args: unknown) => void) => void;
|
|
305
|
-
}
|
|
306
|
-
type RoleName = "none" | "visitor" | "granted_visitor" | "viewer" | "granted_viewer" | "host" | "recorder" | "streamer";
|
|
307
|
-
interface ClientRole {
|
|
308
|
-
roleName: RoleName;
|
|
309
|
-
}
|
|
310
|
-
interface SignalKnocker {
|
|
311
|
-
clientId: string;
|
|
312
|
-
displayName: string | null;
|
|
313
|
-
imageUrl: string | null;
|
|
314
|
-
liveVideo: boolean;
|
|
315
|
-
userAvatarUrl: string | null;
|
|
316
|
-
userId: string | null;
|
|
317
|
-
}
|
|
318
|
-
interface SignalClient {
|
|
319
|
-
displayName: string;
|
|
320
|
-
id: string;
|
|
321
|
-
streams: string[];
|
|
322
|
-
isAudioEnabled: boolean;
|
|
323
|
-
isVideoEnabled: boolean;
|
|
324
|
-
role: ClientRole;
|
|
325
|
-
startedCloudRecordingAt: string | null;
|
|
326
|
-
externalId: string | null;
|
|
327
|
-
isDialIn: boolean;
|
|
214
|
+
setEventClaim?(eventClaim: string): void;
|
|
215
|
+
hasClient(clientId: string): boolean;
|
|
328
216
|
}
|
|
329
|
-
interface
|
|
330
|
-
|
|
331
|
-
streamId: string;
|
|
217
|
+
interface RtcManagerCreatedPayload {
|
|
218
|
+
rtcManager: RtcManager;
|
|
332
219
|
}
|
|
333
|
-
interface
|
|
220
|
+
interface RtcStreamAddedPayload {
|
|
334
221
|
clientId: string;
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
id: string;
|
|
339
|
-
messageType: "text";
|
|
340
|
-
roomName: string;
|
|
341
|
-
senderId: string;
|
|
342
|
-
sig: string;
|
|
343
|
-
text: string;
|
|
344
|
-
timestamp: string;
|
|
345
|
-
userId: string;
|
|
346
|
-
}
|
|
347
|
-
interface CloudRecordingStartedEvent {
|
|
348
|
-
error?: string;
|
|
349
|
-
startedAt?: string;
|
|
222
|
+
stream: MediaStream;
|
|
223
|
+
streamId: string | undefined;
|
|
224
|
+
streamType: "webcam" | "screenshare" | undefined;
|
|
350
225
|
}
|
|
351
|
-
interface
|
|
226
|
+
interface RtcClientConnectionStatusChangedPayload {
|
|
227
|
+
streamIds: string[];
|
|
352
228
|
clientId: string;
|
|
229
|
+
status: string;
|
|
230
|
+
previous: string;
|
|
353
231
|
}
|
|
354
|
-
interface
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
createdAt: string;
|
|
359
|
-
id: string;
|
|
360
|
-
} | null;
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
interface ClientKickedEvent {
|
|
364
|
-
clientId: string;
|
|
232
|
+
interface RtcLocalStreamTrackAddedPayload {
|
|
233
|
+
streamId: string;
|
|
234
|
+
tracks: MediaStreamTrack[];
|
|
235
|
+
screenShare: boolean;
|
|
365
236
|
}
|
|
366
|
-
interface
|
|
367
|
-
|
|
237
|
+
interface RtcLocalStreamTrackRemovedPayload {
|
|
238
|
+
stream: MediaStream;
|
|
239
|
+
track: MediaStreamTrack;
|
|
368
240
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
241
|
+
type RtcEvents = {
|
|
242
|
+
client_connection_status_changed: RtcClientConnectionStatusChangedPayload;
|
|
243
|
+
stream_added: RtcStreamAddedPayload;
|
|
244
|
+
rtc_manager_created: RtcManagerCreatedPayload;
|
|
245
|
+
rtc_manager_destroyed: void;
|
|
246
|
+
local_stream_track_added: RtcLocalStreamTrackAddedPayload;
|
|
247
|
+
local_stream_track_removed: RtcLocalStreamTrackRemovedPayload;
|
|
248
|
+
remote_stream_track_added: void;
|
|
249
|
+
remote_stream_track_removed: void;
|
|
250
|
+
};
|
|
251
|
+
type GetMediaConstraintsOptions = {
|
|
252
|
+
disableAEC: boolean;
|
|
253
|
+
disableAGC: boolean;
|
|
254
|
+
hd: boolean;
|
|
255
|
+
lax: boolean;
|
|
256
|
+
lowDataMode: boolean;
|
|
257
|
+
preferredDeviceIds: {
|
|
258
|
+
audioId?: boolean | string | null | {
|
|
259
|
+
ideal?: string | null;
|
|
260
|
+
exact?: string | null;
|
|
261
|
+
};
|
|
262
|
+
videoId?: boolean | string | null | {
|
|
263
|
+
ideal?: string | null;
|
|
264
|
+
exact?: string | null;
|
|
265
|
+
};
|
|
374
266
|
};
|
|
375
|
-
resolution
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
267
|
+
resolution?: string;
|
|
268
|
+
simulcast: boolean;
|
|
269
|
+
widescreen: boolean;
|
|
270
|
+
usingAspectRatio16x9: boolean;
|
|
271
|
+
};
|
|
272
|
+
type GetConstraintsOptions = {
|
|
273
|
+
devices: MediaDeviceInfo[];
|
|
274
|
+
audioId?: boolean | string;
|
|
275
|
+
videoId?: boolean | string;
|
|
276
|
+
type?: "ideal" | "exact";
|
|
277
|
+
options: Omit<GetMediaConstraintsOptions, "preferredDeviceIds">;
|
|
278
|
+
};
|
|
279
|
+
type GetStreamOptions = {
|
|
280
|
+
replaceStream?: MediaStream;
|
|
281
|
+
fallback?: boolean;
|
|
282
|
+
};
|
|
283
|
+
type GetStreamResult = {
|
|
284
|
+
error?: unknown;
|
|
285
|
+
replacedTracks?: MediaStreamTrack[];
|
|
286
|
+
stream: MediaStream;
|
|
287
|
+
};
|
|
288
|
+
type GetUpdatedDevicesResult = {
|
|
289
|
+
addedDevices: {
|
|
290
|
+
audioinput?: {
|
|
291
|
+
deviceId: string;
|
|
292
|
+
label: string;
|
|
293
|
+
kind: string;
|
|
294
|
+
};
|
|
295
|
+
videoinput?: {
|
|
296
|
+
deviceId: string;
|
|
297
|
+
label: string;
|
|
298
|
+
kind: string;
|
|
299
|
+
};
|
|
300
|
+
audiooutput?: {
|
|
301
|
+
deviceId: string;
|
|
302
|
+
label: string;
|
|
303
|
+
kind: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
changedDevices: {
|
|
307
|
+
audioinput?: {
|
|
308
|
+
deviceId: string;
|
|
309
|
+
label: string;
|
|
310
|
+
kind: string;
|
|
311
|
+
};
|
|
312
|
+
videoinput?: {
|
|
313
|
+
deviceId: string;
|
|
314
|
+
label: string;
|
|
315
|
+
kind: string;
|
|
316
|
+
};
|
|
317
|
+
audiooutput?: {
|
|
318
|
+
deviceId: string;
|
|
319
|
+
label: string;
|
|
320
|
+
kind: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
type GetDeviceDataResult = {
|
|
325
|
+
audio: {
|
|
326
|
+
deviceId: string;
|
|
327
|
+
label: string;
|
|
328
|
+
kind: string;
|
|
329
|
+
};
|
|
330
|
+
video: {
|
|
331
|
+
deviceId: string;
|
|
332
|
+
label: string;
|
|
333
|
+
kind: string;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
interface CustomMediaStreamTrack extends MediaStreamTrack {
|
|
337
|
+
effectTrack?: boolean;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, preferredDeviceIds, resolution, simulcast, widescreen, }: GetMediaConstraintsOptions): any;
|
|
341
|
+
declare function getConstraints({ devices, videoId, audioId, options, type }: GetConstraintsOptions): any;
|
|
342
|
+
|
|
343
|
+
declare const isMobile: boolean;
|
|
344
|
+
declare class NoDevicesError extends Error {
|
|
345
|
+
constructor(...args: any);
|
|
346
|
+
}
|
|
347
|
+
declare function enumerate(): Promise<MediaDeviceInfo[]>;
|
|
348
|
+
declare function buildDeviceList({ busyDeviceIds, devices, kind }: any): any;
|
|
349
|
+
declare function getUserMedia(constraints: any): Promise<MediaStream>;
|
|
350
|
+
declare function getDeviceData({ audioTrack, videoTrack, devices, stoppedVideoTrack, lastAudioId, lastVideoId, }: {
|
|
351
|
+
audioTrack?: MediaStreamTrack | null;
|
|
352
|
+
videoTrack?: MediaStreamTrack | null;
|
|
353
|
+
devices: MediaDeviceInfo[];
|
|
354
|
+
stoppedVideoTrack?: boolean;
|
|
355
|
+
lastAudioId?: string | undefined;
|
|
356
|
+
lastVideoId?: string | undefined;
|
|
357
|
+
}): GetDeviceDataResult;
|
|
358
|
+
declare function stopStreamTracks(stream: MediaStream, only?: "audio" | "video" | false): void;
|
|
359
|
+
declare function replaceTracksInStream(stream: MediaStream, newStream: MediaStream, only: "audio" | "video" | false): MediaStreamTrack[];
|
|
360
|
+
declare function getStream2(constraintOpt: GetConstraintsOptions, additionalOpts?: GetStreamOptions): Promise<GetStreamResult>;
|
|
361
|
+
declare function getStream(constraintOpt: any, { replaceStream, fallback }?: GetStreamOptions): Promise<GetStreamResult>;
|
|
362
|
+
declare function hasGetDisplayMedia(): boolean;
|
|
363
|
+
declare function getDisplayMedia(constraints?: {
|
|
364
|
+
video: {
|
|
365
|
+
width: {
|
|
366
|
+
max: number;
|
|
367
|
+
};
|
|
368
|
+
height: {
|
|
369
|
+
max: number;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
}, contentHint?: string): Promise<MediaStream>;
|
|
373
|
+
declare function compareLocalDevices(before: any, after: any): any;
|
|
374
|
+
declare function getUpdatedDevices({ oldDevices, newDevices, currentAudioId, currentVideoId, currentSpeakerId, }: {
|
|
375
|
+
oldDevices: MediaDeviceInfo[];
|
|
376
|
+
newDevices: MediaDeviceInfo[];
|
|
377
|
+
currentAudioId?: string | undefined;
|
|
378
|
+
currentVideoId?: string | undefined;
|
|
379
|
+
currentSpeakerId?: string | undefined;
|
|
380
|
+
}): GetUpdatedDevicesResult;
|
|
381
|
+
|
|
382
|
+
declare class P2pRtcManager implements RtcManager {
|
|
383
|
+
_selfId: any;
|
|
384
|
+
_roomName: any;
|
|
385
|
+
_roomSessionId: any;
|
|
386
|
+
peerConnections: any;
|
|
387
|
+
localStreams: any;
|
|
388
|
+
enabledLocalStreamIds: any[];
|
|
389
|
+
_screenshareVideoTrackIds: any[];
|
|
390
|
+
_socketListenerDeregisterFunctions: any[];
|
|
391
|
+
_localStreamDeregisterFunction: any;
|
|
392
|
+
_emitter: any;
|
|
393
|
+
_serverSocket: any;
|
|
394
|
+
_webrtcProvider: any;
|
|
395
|
+
_features: any;
|
|
396
|
+
_isAudioOnlyMode: boolean;
|
|
397
|
+
offerOptions: {
|
|
398
|
+
offerToReceiveAudio: boolean;
|
|
399
|
+
offerToReceiveVideo: boolean;
|
|
400
|
+
};
|
|
401
|
+
_pendingActionsForConnectedPeerConnections: any[];
|
|
402
|
+
_audioTrackOnEnded: () => void;
|
|
403
|
+
_videoTrackOnEnded: () => void;
|
|
404
|
+
totalSessionsCreated: number;
|
|
405
|
+
_iceServers: any;
|
|
406
|
+
_sfuServer: any;
|
|
407
|
+
_mediaserverConfigTtlSeconds: any;
|
|
408
|
+
_fetchMediaServersTimer: any;
|
|
409
|
+
_wasScreenSharing: any;
|
|
410
|
+
ipv6HostCandidateTeredoSeen: any;
|
|
411
|
+
ipv6HostCandidate6to4Seen: any;
|
|
412
|
+
mdnsHostCandidateSeen: any;
|
|
413
|
+
_lastReverseDirectionAttemptByClientId: any;
|
|
414
|
+
_stoppedVideoTrack: any;
|
|
415
|
+
icePublicIPGatheringTimeoutID: any;
|
|
416
|
+
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
417
|
+
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
418
|
+
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
419
|
+
selfId: any;
|
|
420
|
+
room: any;
|
|
421
|
+
emitter: any;
|
|
422
|
+
serverSocket: any;
|
|
423
|
+
webrtcProvider: any;
|
|
424
|
+
features: any;
|
|
425
|
+
});
|
|
426
|
+
numberOfPeerconnections(): number;
|
|
427
|
+
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
428
|
+
selfId: any;
|
|
429
|
+
roomName: any;
|
|
430
|
+
isSfu: any;
|
|
431
|
+
}): boolean;
|
|
432
|
+
supportsScreenShareAudio(): boolean;
|
|
433
|
+
maybeRestrictRelayBandwidth(session: any): void;
|
|
434
|
+
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
435
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
436
|
+
disconnectAll(): void;
|
|
437
|
+
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
438
|
+
setupSocketListeners(): void;
|
|
439
|
+
sendAudioMutedStats(muted: boolean): void;
|
|
440
|
+
sendVideoMutedStats(muted: boolean): void;
|
|
441
|
+
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
442
|
+
rtcStatsDisconnect(): void;
|
|
443
|
+
rtcStatsReconnect(): void;
|
|
444
|
+
setAudioOnly(audioOnly: any): void;
|
|
445
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
446
|
+
setRoomSessionId(roomSessionId: string): void;
|
|
447
|
+
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
448
|
+
_setJitterBufferTarget(pc: any): void;
|
|
449
|
+
_emitServerEvent(eventName: string, data?: any, callback?: any): void;
|
|
450
|
+
_emit(eventName: string, data?: any): void;
|
|
451
|
+
_addEnabledLocalStreamId(streamId: string): void;
|
|
452
|
+
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
453
|
+
_getSession(peerConnectionId: string): any;
|
|
454
|
+
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
455
|
+
_getLocalCameraStream(): any;
|
|
456
|
+
_getNonLocalCameraStreamIds(): string[];
|
|
457
|
+
_isScreensharingLocally(): boolean;
|
|
458
|
+
_getFirstLocalNonCameraStream(): any;
|
|
459
|
+
_transformIncomingSdp(original: any, _: any): {
|
|
460
|
+
type: any;
|
|
461
|
+
sdp: any;
|
|
462
|
+
};
|
|
463
|
+
_transformOutgoingSdp(original: any): {
|
|
464
|
+
type: any;
|
|
465
|
+
sdpU: any;
|
|
466
|
+
};
|
|
467
|
+
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
|
|
468
|
+
clientId: string;
|
|
469
|
+
initialBandwidth: any;
|
|
470
|
+
isOfferer: any;
|
|
471
|
+
peerConnectionId: string;
|
|
472
|
+
shouldAddLocalVideo: boolean;
|
|
473
|
+
}): any;
|
|
474
|
+
_cleanup(peerConnectionId: string): void;
|
|
475
|
+
_forEachPeerConnection(func: any): void;
|
|
476
|
+
_addStreamToPeerConnections(stream: any): void;
|
|
477
|
+
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
478
|
+
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
479
|
+
_removeStreamFromPeerConnections(stream: any): void;
|
|
480
|
+
_removeTrackFromPeerConnections(track: any): void;
|
|
481
|
+
_addLocalStream(streamId: string, stream: any): void;
|
|
482
|
+
_removeLocalStream(streamId: string): void;
|
|
483
|
+
_updateAndScheduleMediaServersRefresh({ iceServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
484
|
+
_clearMediaServersRefresh(): void;
|
|
485
|
+
_monitorAudioTrack(track: any): void;
|
|
486
|
+
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
487
|
+
_connect(clientId: string): Promise<any>;
|
|
488
|
+
_maybeRestartIce(clientId: string, session: any): void;
|
|
489
|
+
_setCodecPreferences(pc: any, vp9On: any, av1On: any, redOn: any): void;
|
|
490
|
+
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
491
|
+
_withForcedRenegotiation(session: any, action: any): void;
|
|
492
|
+
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
493
|
+
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, }: {
|
|
494
|
+
clientId: string;
|
|
495
|
+
initialBandwidth: number;
|
|
496
|
+
shouldAddLocalVideo: boolean;
|
|
497
|
+
isOfferer: boolean;
|
|
498
|
+
}): any;
|
|
499
|
+
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
|
|
500
|
+
streamId: string;
|
|
501
|
+
clientId: string;
|
|
502
|
+
shouldAddLocalVideo?: boolean;
|
|
503
|
+
}): any;
|
|
504
|
+
disconnect(clientId: string): void;
|
|
505
|
+
updateStreamResolution(): void;
|
|
506
|
+
stopOrResumeAudio(): void;
|
|
507
|
+
_handleStopOrResumeVideo({ enable, track }: {
|
|
508
|
+
enable: boolean;
|
|
509
|
+
track: any;
|
|
510
|
+
}): void;
|
|
511
|
+
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
512
|
+
_shareScreen(streamId: string, stream: any): void;
|
|
513
|
+
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
514
|
+
hasClient(clientId: string): boolean;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
declare const assert: {
|
|
518
|
+
fail: (message?: string | Error) => void;
|
|
519
|
+
ok: (value: any, message?: string | Error) => void;
|
|
520
|
+
equal?: (actual: any, expected: any, message?: string | Error) => void;
|
|
521
|
+
notEqual?: (actual: any, expected: any, message?: string | Error) => void;
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
declare const createWorker: (fn: Function) => Worker;
|
|
525
|
+
declare const generateByteString: (count: number) => string;
|
|
526
|
+
|
|
527
|
+
declare const getHandler: () => mediasoup_client_lib_Device.BuiltinHandlerName | undefined;
|
|
528
|
+
|
|
529
|
+
declare const ipRegex: {
|
|
530
|
+
(options: {
|
|
531
|
+
exact: boolean;
|
|
532
|
+
includeBoundaries?: boolean;
|
|
533
|
+
}): RegExp;
|
|
534
|
+
v4(options: {
|
|
535
|
+
exact: boolean;
|
|
536
|
+
includeBoundaries?: boolean;
|
|
537
|
+
}): RegExp;
|
|
538
|
+
v6(options: {
|
|
539
|
+
exact: boolean;
|
|
540
|
+
includeBoundaries?: boolean;
|
|
541
|
+
}): RegExp;
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: any) => {
|
|
545
|
+
encodings: {}[];
|
|
546
|
+
};
|
|
547
|
+
declare const modifyMediaCapabilities: (routerRtpCapabilities: any, features: any) => void;
|
|
548
|
+
|
|
549
|
+
declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
|
|
550
|
+
|
|
551
|
+
declare class ReconnectManager extends EventEmitter {
|
|
552
|
+
_socket: any;
|
|
553
|
+
_clients: any;
|
|
554
|
+
_signalDisconnectTime?: number;
|
|
555
|
+
rtcManager?: RtcManager;
|
|
556
|
+
metrics: {
|
|
557
|
+
roomJoinedLate: number;
|
|
558
|
+
pendingClientCanceled: number;
|
|
559
|
+
evaluationFailed: number;
|
|
560
|
+
roomJoined: number;
|
|
561
|
+
};
|
|
562
|
+
reconnectThresholdInMs: number;
|
|
563
|
+
constructor(socket: any);
|
|
564
|
+
_onRoomJoined(payload: any): Promise<void>;
|
|
565
|
+
_onClientLeft(payload: any): void;
|
|
566
|
+
_onPendingClientLeft(payload: any): void;
|
|
567
|
+
_onNewClient(payload: any): void;
|
|
568
|
+
_abortIfNotActive(payload: any): Promise<void>;
|
|
569
|
+
_checkIsActive(clientId: string): Promise<boolean>;
|
|
570
|
+
_isClientMediaActive(stats: any, clientId: string): boolean;
|
|
571
|
+
_onAudioEnabled(payload: any): void;
|
|
572
|
+
_onVideoEnabled(payload: any): void;
|
|
573
|
+
_onScreenshareChanged(payload: any, action: boolean): void;
|
|
574
|
+
_hasClientStateChanged({ clientId, webcam, mic, screenShare, }: {
|
|
575
|
+
clientId: string;
|
|
576
|
+
webcam: boolean;
|
|
577
|
+
mic: boolean;
|
|
578
|
+
screenShare: boolean;
|
|
579
|
+
}): boolean;
|
|
580
|
+
_addClientToState(newClient: any): void;
|
|
581
|
+
_wasClientSendingMedia(clientId: string): any;
|
|
582
|
+
_getPendingClientsByDeviceId(deviceId: string): unknown[];
|
|
583
|
+
_resetClientState(payload: any): void;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare class ServerSocket {
|
|
587
|
+
_socket: any;
|
|
588
|
+
_reconnectManager?: ReconnectManager | null;
|
|
589
|
+
noopKeepaliveInterval: any;
|
|
590
|
+
_wasConnectedUsingWebsocket?: boolean;
|
|
591
|
+
disconnectTimestamp: number | undefined;
|
|
592
|
+
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean);
|
|
593
|
+
setRtcManager(rtcManager?: RtcManager): void;
|
|
594
|
+
connect(): void;
|
|
595
|
+
disconnect(): void;
|
|
596
|
+
disconnectOnConnect(): void;
|
|
597
|
+
emit(eventName: string, ...args: any[]): void;
|
|
598
|
+
emitIfConnected(eventName: string, data: any): void;
|
|
599
|
+
getTransport(): any;
|
|
600
|
+
getManager(): any;
|
|
601
|
+
isConnecting(): any;
|
|
602
|
+
isConnected(): any;
|
|
603
|
+
on(eventName: string, handler: Function): () => void;
|
|
604
|
+
once(eventName: string, handler: Function): void;
|
|
605
|
+
off(eventName: string, handler: Function): void;
|
|
606
|
+
_interceptEvent(eventName: string, handler: any): () => void;
|
|
607
|
+
getGlitchFreeMetrics(): {
|
|
608
|
+
roomJoinedLate: number;
|
|
609
|
+
pendingClientCanceled: number;
|
|
610
|
+
evaluationFailed: number;
|
|
611
|
+
roomJoined: number;
|
|
612
|
+
} | undefined;
|
|
613
|
+
getReconnectThreshold(): number | undefined;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
declare const maybeTurnOnly: (transportConfig: any, features: {
|
|
617
|
+
useOnlyTURN: string;
|
|
618
|
+
}) => void;
|
|
619
|
+
|
|
620
|
+
interface Credentials {
|
|
621
|
+
credentials: {
|
|
622
|
+
uuid: string;
|
|
623
|
+
};
|
|
624
|
+
hmac: string;
|
|
625
|
+
userId: string;
|
|
626
|
+
}
|
|
627
|
+
interface SocketConf {
|
|
628
|
+
host?: string;
|
|
629
|
+
path?: string;
|
|
630
|
+
reconnectionDelay?: number;
|
|
631
|
+
reconnectionDelayMax?: number;
|
|
632
|
+
timeout?: number;
|
|
633
|
+
autoConnect?: boolean;
|
|
634
|
+
}
|
|
635
|
+
interface SocketManager {
|
|
636
|
+
on: (eventName: string, callback: (args: unknown) => void) => void;
|
|
637
|
+
}
|
|
638
|
+
type RoleName = "none" | "visitor" | "granted_visitor" | "viewer" | "granted_viewer" | "host" | "recorder" | "streamer";
|
|
639
|
+
interface ClientRole {
|
|
640
|
+
roleName: RoleName;
|
|
641
|
+
}
|
|
642
|
+
interface SignalKnocker {
|
|
643
|
+
clientId: string;
|
|
644
|
+
displayName: string | null;
|
|
645
|
+
imageUrl: string | null;
|
|
646
|
+
liveVideo: boolean;
|
|
647
|
+
userAvatarUrl: string | null;
|
|
648
|
+
userId: string | null;
|
|
649
|
+
}
|
|
650
|
+
interface SignalClient {
|
|
651
|
+
displayName: string;
|
|
652
|
+
id: string;
|
|
653
|
+
streams: string[];
|
|
654
|
+
isAudioEnabled: boolean;
|
|
655
|
+
isVideoEnabled: boolean;
|
|
656
|
+
role: ClientRole;
|
|
657
|
+
startedCloudRecordingAt: string | null;
|
|
658
|
+
externalId: string | null;
|
|
659
|
+
isDialIn: boolean;
|
|
660
|
+
}
|
|
661
|
+
interface Spotlight {
|
|
662
|
+
clientId: string;
|
|
663
|
+
streamId: string;
|
|
664
|
+
}
|
|
665
|
+
interface AudioEnabledEvent {
|
|
666
|
+
clientId: string;
|
|
667
|
+
isAudioEnabled: boolean;
|
|
668
|
+
}
|
|
669
|
+
interface ChatMessage {
|
|
670
|
+
id: string;
|
|
671
|
+
messageType: "text";
|
|
672
|
+
roomName: string;
|
|
673
|
+
senderId: string;
|
|
674
|
+
sig: string;
|
|
675
|
+
text: string;
|
|
676
|
+
timestamp: string;
|
|
677
|
+
userId: string;
|
|
678
|
+
}
|
|
679
|
+
interface CloudRecordingStartedEvent {
|
|
680
|
+
error?: string;
|
|
681
|
+
startedAt?: string;
|
|
682
|
+
}
|
|
683
|
+
interface ClientLeftEvent {
|
|
684
|
+
clientId: string;
|
|
685
|
+
}
|
|
686
|
+
interface NewClientEvent {
|
|
687
|
+
client: SignalClient;
|
|
688
|
+
room?: {
|
|
689
|
+
session: {
|
|
690
|
+
createdAt: string;
|
|
691
|
+
id: string;
|
|
692
|
+
} | null;
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
interface ClientKickedEvent {
|
|
696
|
+
clientId: string;
|
|
697
|
+
}
|
|
698
|
+
interface KnockerLeftEvent {
|
|
699
|
+
clientId: string;
|
|
700
|
+
}
|
|
701
|
+
interface KnockAcceptedEvent {
|
|
702
|
+
clientId: string;
|
|
703
|
+
metadata: {
|
|
704
|
+
roomKey: string;
|
|
705
|
+
roomName: string;
|
|
706
|
+
};
|
|
707
|
+
resolution: "accepted";
|
|
708
|
+
}
|
|
709
|
+
interface KnockRejectedEvent {
|
|
710
|
+
clientId: string;
|
|
711
|
+
resolution: "rejected";
|
|
712
|
+
}
|
|
713
|
+
interface RoomJoinedEvent {
|
|
382
714
|
error?: string;
|
|
383
715
|
isLocked: boolean;
|
|
384
716
|
room?: {
|
|
@@ -522,409 +854,72 @@ interface SendClientMetadataRequest {
|
|
|
522
854
|
payload: ClientMetadataPayload;
|
|
523
855
|
}
|
|
524
856
|
interface AudioEnableRequest {
|
|
525
|
-
clientIds: string[];
|
|
526
|
-
enable: boolean;
|
|
527
|
-
}
|
|
528
|
-
interface VideoEnableRequest {
|
|
529
|
-
clientIds: string[];
|
|
530
|
-
enable: boolean;
|
|
531
|
-
}
|
|
532
|
-
interface AddSpotlightRequest {
|
|
533
|
-
clientId: string;
|
|
534
|
-
streamId: string;
|
|
535
|
-
}
|
|
536
|
-
interface RemoveSpotlightRequest {
|
|
537
|
-
clientId: string;
|
|
538
|
-
streamId: string;
|
|
539
|
-
}
|
|
540
|
-
interface SignalRequests {
|
|
541
|
-
add_spotlight: AddSpotlightRequest;
|
|
542
|
-
chat_message: {
|
|
543
|
-
text: string;
|
|
544
|
-
};
|
|
545
|
-
enable_audio: {
|
|
546
|
-
enabled: boolean;
|
|
547
|
-
};
|
|
548
|
-
enable_video: {
|
|
549
|
-
enabled: boolean;
|
|
550
|
-
};
|
|
551
|
-
handle_knock: {
|
|
552
|
-
action: "accept" | "reject";
|
|
553
|
-
clientId: string;
|
|
554
|
-
response: unknown;
|
|
555
|
-
};
|
|
556
|
-
identify_device: IdentifyDeviceRequest;
|
|
557
|
-
join_room: JoinRoomRequest;
|
|
558
|
-
knock_room: KnockRoomRequest;
|
|
559
|
-
leave_room: void;
|
|
560
|
-
remove_spotlight: RemoveSpotlightRequest;
|
|
561
|
-
request_audio_enable: AudioEnableRequest;
|
|
562
|
-
request_video_enable: VideoEnableRequest;
|
|
563
|
-
send_client_metadata: {
|
|
564
|
-
type: string;
|
|
565
|
-
payload: {
|
|
566
|
-
displayName?: string;
|
|
567
|
-
stickyReaction?: unknown;
|
|
568
|
-
};
|
|
569
|
-
};
|
|
570
|
-
set_lock: {
|
|
571
|
-
locked: boolean;
|
|
572
|
-
};
|
|
573
|
-
start_recording: {
|
|
574
|
-
recording: string;
|
|
575
|
-
};
|
|
576
|
-
stop_recording: void;
|
|
577
|
-
}
|
|
578
|
-
type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
|
|
579
|
-
|
|
580
|
-
declare function fromLocation({ host, protocol }?: {
|
|
581
|
-
host?: string | undefined;
|
|
582
|
-
protocol?: string | undefined;
|
|
583
|
-
}): {
|
|
584
|
-
domain: string;
|
|
585
|
-
domainWithSeparator: string;
|
|
586
|
-
organizationDomain: string;
|
|
587
|
-
organization: string;
|
|
588
|
-
service: string;
|
|
589
|
-
subdomain: string;
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
declare enum RtcEventNames {
|
|
593
|
-
rtc_manager_created = "rtc_manager_created",
|
|
594
|
-
stream_added = "stream_added"
|
|
595
|
-
}
|
|
596
|
-
interface RtcManager {
|
|
597
|
-
acceptNewStream: ({ activeBreakout, clientId, shouldAddLocalVideo, streamId, enforceTurnProtocol, }: {
|
|
598
|
-
activeBreakout: boolean;
|
|
599
|
-
clientId: string;
|
|
600
|
-
shouldAddLocalVideo: boolean;
|
|
601
|
-
streamId: string;
|
|
602
|
-
enforceTurnProtocol?: TurnTransportProtocol;
|
|
603
|
-
}) => void;
|
|
604
|
-
addNewStream(streamId: string, stream: MediaStream, isAudioEnabled: boolean, isVideoEnabled: boolean): void;
|
|
605
|
-
disconnect(streamId: string, activeBreakout: boolean | null, eventClaim?: string): void;
|
|
606
|
-
disconnectAll(): void;
|
|
607
|
-
rtcStatsDisconnect(): void;
|
|
608
|
-
rtcStatsReconnect(): void;
|
|
609
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack, newTrack: CustomMediaStreamTrack): void;
|
|
610
|
-
removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string | null): void;
|
|
611
|
-
shouldAcceptStreamsFromBothSides?: () => boolean;
|
|
612
|
-
updateStreamResolution(streamId: string, ignored: null, resolution: {
|
|
613
|
-
width: number;
|
|
614
|
-
height: number;
|
|
615
|
-
}): void;
|
|
616
|
-
sendStatsCustomEvent(eventName: string, data: unknown): void;
|
|
617
|
-
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
618
|
-
selfId: string;
|
|
619
|
-
roomName: string;
|
|
620
|
-
isSfu: boolean;
|
|
621
|
-
}): boolean;
|
|
622
|
-
setEventClaim?(eventClaim: string): void;
|
|
623
|
-
hasClient(clientId: string): boolean;
|
|
624
|
-
}
|
|
625
|
-
interface RtcManagerCreatedPayload {
|
|
626
|
-
rtcManager: RtcManager;
|
|
627
|
-
}
|
|
628
|
-
interface RtcStreamAddedPayload {
|
|
629
|
-
clientId: string;
|
|
630
|
-
stream: MediaStream;
|
|
631
|
-
streamId: string | undefined;
|
|
632
|
-
streamType: "webcam" | "screenshare" | undefined;
|
|
633
|
-
}
|
|
634
|
-
interface RtcClientConnectionStatusChangedPayload {
|
|
635
|
-
streamIds: string[];
|
|
636
|
-
clientId: string;
|
|
637
|
-
status: string;
|
|
638
|
-
previous: string;
|
|
639
|
-
}
|
|
640
|
-
interface RtcLocalStreamTrackAddedPayload {
|
|
641
|
-
streamId: string;
|
|
642
|
-
tracks: MediaStreamTrack[];
|
|
643
|
-
screenShare: boolean;
|
|
644
|
-
}
|
|
645
|
-
interface RtcLocalStreamTrackRemovedPayload {
|
|
646
|
-
stream: MediaStream;
|
|
647
|
-
track: MediaStreamTrack;
|
|
648
|
-
}
|
|
649
|
-
type RtcEvents = {
|
|
650
|
-
client_connection_status_changed: RtcClientConnectionStatusChangedPayload;
|
|
651
|
-
stream_added: RtcStreamAddedPayload;
|
|
652
|
-
rtc_manager_created: RtcManagerCreatedPayload;
|
|
653
|
-
rtc_manager_destroyed: void;
|
|
654
|
-
local_stream_track_added: RtcLocalStreamTrackAddedPayload;
|
|
655
|
-
local_stream_track_removed: RtcLocalStreamTrackRemovedPayload;
|
|
656
|
-
remote_stream_track_added: void;
|
|
657
|
-
remote_stream_track_removed: void;
|
|
658
|
-
};
|
|
659
|
-
type GetMediaConstraintsOptions = {
|
|
660
|
-
disableAEC: boolean;
|
|
661
|
-
disableAGC: boolean;
|
|
662
|
-
hd: boolean;
|
|
663
|
-
lax: boolean;
|
|
664
|
-
lowDataMode: boolean;
|
|
665
|
-
preferredDeviceIds: {
|
|
666
|
-
audioId?: boolean | string | null | {
|
|
667
|
-
ideal?: string | null;
|
|
668
|
-
exact?: string | null;
|
|
669
|
-
};
|
|
670
|
-
videoId?: boolean | string | null | {
|
|
671
|
-
ideal?: string | null;
|
|
672
|
-
exact?: string | null;
|
|
673
|
-
};
|
|
674
|
-
};
|
|
675
|
-
resolution?: string;
|
|
676
|
-
simulcast: boolean;
|
|
677
|
-
widescreen: boolean;
|
|
678
|
-
usingAspectRatio16x9: boolean;
|
|
679
|
-
};
|
|
680
|
-
type GetConstraintsOptions = {
|
|
681
|
-
devices: MediaDeviceInfo[];
|
|
682
|
-
audioId?: boolean | string;
|
|
683
|
-
videoId?: boolean | string;
|
|
684
|
-
type?: "ideal" | "exact";
|
|
685
|
-
options: Omit<GetMediaConstraintsOptions, "preferredDeviceIds">;
|
|
686
|
-
};
|
|
687
|
-
type GetStreamOptions = {
|
|
688
|
-
replaceStream?: MediaStream;
|
|
689
|
-
fallback?: boolean;
|
|
690
|
-
};
|
|
691
|
-
type GetStreamResult = {
|
|
692
|
-
error?: unknown;
|
|
693
|
-
replacedTracks?: MediaStreamTrack[];
|
|
694
|
-
stream: MediaStream;
|
|
695
|
-
};
|
|
696
|
-
type GetUpdatedDevicesResult = {
|
|
697
|
-
addedDevices: {
|
|
698
|
-
audioinput?: {
|
|
699
|
-
deviceId: string;
|
|
700
|
-
label: string;
|
|
701
|
-
kind: string;
|
|
702
|
-
};
|
|
703
|
-
videoinput?: {
|
|
704
|
-
deviceId: string;
|
|
705
|
-
label: string;
|
|
706
|
-
kind: string;
|
|
707
|
-
};
|
|
708
|
-
audiooutput?: {
|
|
709
|
-
deviceId: string;
|
|
710
|
-
label: string;
|
|
711
|
-
kind: string;
|
|
712
|
-
};
|
|
857
|
+
clientIds: string[];
|
|
858
|
+
enable: boolean;
|
|
859
|
+
}
|
|
860
|
+
interface VideoEnableRequest {
|
|
861
|
+
clientIds: string[];
|
|
862
|
+
enable: boolean;
|
|
863
|
+
}
|
|
864
|
+
interface AddSpotlightRequest {
|
|
865
|
+
clientId: string;
|
|
866
|
+
streamId: string;
|
|
867
|
+
}
|
|
868
|
+
interface RemoveSpotlightRequest {
|
|
869
|
+
clientId: string;
|
|
870
|
+
streamId: string;
|
|
871
|
+
}
|
|
872
|
+
interface SignalRequests {
|
|
873
|
+
add_spotlight: AddSpotlightRequest;
|
|
874
|
+
chat_message: {
|
|
875
|
+
text: string;
|
|
713
876
|
};
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
deviceId: string;
|
|
717
|
-
label: string;
|
|
718
|
-
kind: string;
|
|
719
|
-
};
|
|
720
|
-
videoinput?: {
|
|
721
|
-
deviceId: string;
|
|
722
|
-
label: string;
|
|
723
|
-
kind: string;
|
|
724
|
-
};
|
|
725
|
-
audiooutput?: {
|
|
726
|
-
deviceId: string;
|
|
727
|
-
label: string;
|
|
728
|
-
kind: string;
|
|
729
|
-
};
|
|
877
|
+
enable_audio: {
|
|
878
|
+
enabled: boolean;
|
|
730
879
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
audio: {
|
|
734
|
-
deviceId: string;
|
|
735
|
-
label: string;
|
|
736
|
-
kind: string;
|
|
880
|
+
enable_video: {
|
|
881
|
+
enabled: boolean;
|
|
737
882
|
};
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
883
|
+
handle_knock: {
|
|
884
|
+
action: "accept" | "reject";
|
|
885
|
+
clientId: string;
|
|
886
|
+
response: unknown;
|
|
742
887
|
};
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
declare function enumerate(): Promise<MediaDeviceInfo[]>;
|
|
756
|
-
declare function buildDeviceList({ busyDeviceIds, devices, kind }: any): any;
|
|
757
|
-
declare function getUserMedia(constraints: any): Promise<MediaStream>;
|
|
758
|
-
declare function getDeviceData({ audioTrack, videoTrack, devices, stoppedVideoTrack, lastAudioId, lastVideoId, }: {
|
|
759
|
-
audioTrack?: MediaStreamTrack | null;
|
|
760
|
-
videoTrack?: MediaStreamTrack | null;
|
|
761
|
-
devices: MediaDeviceInfo[];
|
|
762
|
-
stoppedVideoTrack?: boolean;
|
|
763
|
-
lastAudioId?: string | undefined;
|
|
764
|
-
lastVideoId?: string | undefined;
|
|
765
|
-
}): GetDeviceDataResult;
|
|
766
|
-
declare function stopStreamTracks(stream: MediaStream, only?: "audio" | "video" | false): void;
|
|
767
|
-
declare function replaceTracksInStream(stream: MediaStream, newStream: MediaStream, only: "audio" | "video" | false): MediaStreamTrack[];
|
|
768
|
-
declare function getStream2(constraintOpt: GetConstraintsOptions, additionalOpts?: GetStreamOptions): Promise<GetStreamResult>;
|
|
769
|
-
declare function getStream(constraintOpt: any, { replaceStream, fallback }?: GetStreamOptions): Promise<GetStreamResult>;
|
|
770
|
-
declare function hasGetDisplayMedia(): boolean;
|
|
771
|
-
declare function getDisplayMedia(constraints?: {
|
|
772
|
-
video: {
|
|
773
|
-
width: {
|
|
774
|
-
max: number;
|
|
775
|
-
};
|
|
776
|
-
height: {
|
|
777
|
-
max: number;
|
|
888
|
+
identify_device: IdentifyDeviceRequest;
|
|
889
|
+
join_room: JoinRoomRequest;
|
|
890
|
+
knock_room: KnockRoomRequest;
|
|
891
|
+
leave_room: void;
|
|
892
|
+
remove_spotlight: RemoveSpotlightRequest;
|
|
893
|
+
request_audio_enable: AudioEnableRequest;
|
|
894
|
+
request_video_enable: VideoEnableRequest;
|
|
895
|
+
send_client_metadata: {
|
|
896
|
+
type: string;
|
|
897
|
+
payload: {
|
|
898
|
+
displayName?: string;
|
|
899
|
+
stickyReaction?: unknown;
|
|
778
900
|
};
|
|
779
901
|
};
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
declare function getUpdatedDevices({ oldDevices, newDevices, currentAudioId, currentVideoId, currentSpeakerId, }: {
|
|
783
|
-
oldDevices: MediaDeviceInfo[];
|
|
784
|
-
newDevices: MediaDeviceInfo[];
|
|
785
|
-
currentAudioId?: string | undefined;
|
|
786
|
-
currentVideoId?: string | undefined;
|
|
787
|
-
currentSpeakerId?: string | undefined;
|
|
788
|
-
}): GetUpdatedDevicesResult;
|
|
789
|
-
|
|
790
|
-
declare class P2pRtcManager implements RtcManager {
|
|
791
|
-
_selfId: any;
|
|
792
|
-
_roomName: any;
|
|
793
|
-
_roomSessionId: any;
|
|
794
|
-
peerConnections: any;
|
|
795
|
-
localStreams: any;
|
|
796
|
-
enabledLocalStreamIds: any[];
|
|
797
|
-
_screenshareVideoTrackIds: any[];
|
|
798
|
-
_socketListenerDeregisterFunctions: any[];
|
|
799
|
-
_localStreamDeregisterFunction: any;
|
|
800
|
-
_emitter: any;
|
|
801
|
-
_serverSocket: any;
|
|
802
|
-
_webrtcProvider: any;
|
|
803
|
-
_features: any;
|
|
804
|
-
_isAudioOnlyMode: boolean;
|
|
805
|
-
offerOptions: {
|
|
806
|
-
offerToReceiveAudio: boolean;
|
|
807
|
-
offerToReceiveVideo: boolean;
|
|
808
|
-
};
|
|
809
|
-
_pendingActionsForConnectedPeerConnections: any[];
|
|
810
|
-
_audioTrackOnEnded: () => void;
|
|
811
|
-
_videoTrackOnEnded: () => void;
|
|
812
|
-
totalSessionsCreated: number;
|
|
813
|
-
_iceServers: any;
|
|
814
|
-
_sfuServer: any;
|
|
815
|
-
_mediaserverConfigTtlSeconds: any;
|
|
816
|
-
_fetchMediaServersTimer: any;
|
|
817
|
-
_wasScreenSharing: any;
|
|
818
|
-
ipv6HostCandidateTeredoSeen: any;
|
|
819
|
-
ipv6HostCandidate6to4Seen: any;
|
|
820
|
-
mdnsHostCandidateSeen: any;
|
|
821
|
-
_lastReverseDirectionAttemptByClientId: any;
|
|
822
|
-
_stoppedVideoTrack: any;
|
|
823
|
-
icePublicIPGatheringTimeoutID: any;
|
|
824
|
-
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
825
|
-
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
826
|
-
_nodeJsClients: string[];
|
|
827
|
-
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
828
|
-
selfId: any;
|
|
829
|
-
room: any;
|
|
830
|
-
emitter: any;
|
|
831
|
-
serverSocket: any;
|
|
832
|
-
webrtcProvider: any;
|
|
833
|
-
features: any;
|
|
834
|
-
});
|
|
835
|
-
numberOfPeerconnections(): number;
|
|
836
|
-
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
837
|
-
selfId: any;
|
|
838
|
-
roomName: any;
|
|
839
|
-
isSfu: any;
|
|
840
|
-
}): boolean;
|
|
841
|
-
supportsScreenShareAudio(): boolean;
|
|
842
|
-
maybeRestrictRelayBandwidth(session: any): void;
|
|
843
|
-
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
844
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
845
|
-
disconnectAll(): void;
|
|
846
|
-
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
847
|
-
setupSocketListeners(): void;
|
|
848
|
-
sendAudioMutedStats(muted: boolean): void;
|
|
849
|
-
sendVideoMutedStats(muted: boolean): void;
|
|
850
|
-
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
851
|
-
rtcStatsDisconnect(): void;
|
|
852
|
-
rtcStatsReconnect(): void;
|
|
853
|
-
setAudioOnly(audioOnly: any): void;
|
|
854
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
855
|
-
setRoomSessionId(roomSessionId: string): void;
|
|
856
|
-
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
857
|
-
_setJitterBufferTarget(pc: any): void;
|
|
858
|
-
_emitServerEvent(eventName: string, data?: any, callback?: any): void;
|
|
859
|
-
_emit(eventName: string, data?: any): void;
|
|
860
|
-
_addEnabledLocalStreamId(streamId: string): void;
|
|
861
|
-
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
862
|
-
_getSession(peerConnectionId: string): any;
|
|
863
|
-
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
864
|
-
_getLocalCameraStream(): any;
|
|
865
|
-
_getNonLocalCameraStreamIds(): string[];
|
|
866
|
-
_isScreensharingLocally(): boolean;
|
|
867
|
-
_getFirstLocalNonCameraStream(): any;
|
|
868
|
-
_transformIncomingSdp(original: any, _: any): {
|
|
869
|
-
type: any;
|
|
870
|
-
sdp: any;
|
|
902
|
+
set_lock: {
|
|
903
|
+
locked: boolean;
|
|
871
904
|
};
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
sdpU: any;
|
|
905
|
+
start_recording: {
|
|
906
|
+
recording: string;
|
|
875
907
|
};
|
|
876
|
-
|
|
877
|
-
clientId: string;
|
|
878
|
-
initialBandwidth: any;
|
|
879
|
-
isOfferer: any;
|
|
880
|
-
peerConnectionId: string;
|
|
881
|
-
shouldAddLocalVideo: boolean;
|
|
882
|
-
enforceTurnProtocol?: TurnTransportProtocol;
|
|
883
|
-
}): any;
|
|
884
|
-
_cleanup(peerConnectionId: string): void;
|
|
885
|
-
_forEachPeerConnection(func: any): void;
|
|
886
|
-
_addStreamToPeerConnections(stream: any): void;
|
|
887
|
-
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
888
|
-
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
889
|
-
_removeStreamFromPeerConnections(stream: any): void;
|
|
890
|
-
_removeTrackFromPeerConnections(track: any): void;
|
|
891
|
-
_addLocalStream(streamId: string, stream: any): void;
|
|
892
|
-
_removeLocalStream(streamId: string): void;
|
|
893
|
-
_updateAndScheduleMediaServersRefresh({ iceServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
894
|
-
_clearMediaServersRefresh(): void;
|
|
895
|
-
_monitorAudioTrack(track: any): void;
|
|
896
|
-
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
897
|
-
_connect(clientId: string): Promise<any>;
|
|
898
|
-
_maybeRestartIce(clientId: string, session: any): void;
|
|
899
|
-
_setCodecPreferences(pc: any, vp9On: any, av1On: any, redOn: any): void;
|
|
900
|
-
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
901
|
-
_withForcedRenegotiation(session: any, action: any): void;
|
|
902
|
-
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
903
|
-
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, enforceTurnProtocol, }: {
|
|
904
|
-
clientId: string;
|
|
905
|
-
initialBandwidth: number;
|
|
906
|
-
shouldAddLocalVideo: boolean;
|
|
907
|
-
isOfferer: boolean;
|
|
908
|
-
enforceTurnProtocol?: TurnTransportProtocol;
|
|
909
|
-
}): any;
|
|
910
|
-
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, enforceTurnProtocol, }: {
|
|
911
|
-
streamId: string;
|
|
912
|
-
clientId: string;
|
|
913
|
-
shouldAddLocalVideo?: boolean;
|
|
914
|
-
enforceTurnProtocol?: TurnTransportProtocol;
|
|
915
|
-
}): any;
|
|
916
|
-
disconnect(clientId: string): void;
|
|
917
|
-
updateStreamResolution(): void;
|
|
918
|
-
stopOrResumeAudio(): void;
|
|
919
|
-
_handleStopOrResumeVideo({ enable, track }: {
|
|
920
|
-
enable: boolean;
|
|
921
|
-
track: any;
|
|
922
|
-
}): void;
|
|
923
|
-
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
924
|
-
_shareScreen(streamId: string, stream: any): void;
|
|
925
|
-
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
926
|
-
hasClient(clientId: string): boolean;
|
|
908
|
+
stop_recording: void;
|
|
927
909
|
}
|
|
910
|
+
type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
|
|
911
|
+
|
|
912
|
+
declare function fromLocation({ host, protocol }?: {
|
|
913
|
+
host?: string | undefined;
|
|
914
|
+
protocol?: string | undefined;
|
|
915
|
+
}): {
|
|
916
|
+
domain: string;
|
|
917
|
+
domainWithSeparator: string;
|
|
918
|
+
organizationDomain: string;
|
|
919
|
+
organization: string;
|
|
920
|
+
service: string;
|
|
921
|
+
subdomain: string;
|
|
922
|
+
};
|
|
928
923
|
|
|
929
924
|
declare class RtcManagerDispatcher {
|
|
930
925
|
emitter: {
|
|
@@ -1090,7 +1085,6 @@ declare class VegaConnection extends EventEmitter$1 {
|
|
|
1090
1085
|
_setupSocket(): void;
|
|
1091
1086
|
_tearDown(): void;
|
|
1092
1087
|
close(): void;
|
|
1093
|
-
isConnected(): boolean;
|
|
1094
1088
|
_onOpen(): void;
|
|
1095
1089
|
_onMessage(event: MessageEvent): void;
|
|
1096
1090
|
_onClose(): void;
|
|
@@ -1218,6 +1212,7 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1218
1212
|
_mediaserverConfigTtlSeconds: any;
|
|
1219
1213
|
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
1220
1214
|
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
1215
|
+
_hasVegaConnection: boolean;
|
|
1221
1216
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, eventClaim, deviceHandlerFactory, }: {
|
|
1222
1217
|
selfId: any;
|
|
1223
1218
|
room: any;
|