@whereby.com/media 8.0.6 → 8.0.7
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 +24 -5
- package/dist/index.d.cts +42 -31
- package/dist/index.d.mts +42 -31
- package/dist/index.d.ts +42 -31
- package/dist/index.mjs +24 -5
- package/dist/legacy-esm.js +24 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4035,9 +4035,10 @@ class SfuV2Parser {
|
|
|
4035
4035
|
|
|
4036
4036
|
const logger$3 = new Logger();
|
|
4037
4037
|
class VegaConnection extends EventEmitter.EventEmitter {
|
|
4038
|
-
constructor(wsUrl, protocol = "whereby-sfu#v4") {
|
|
4038
|
+
constructor(wsUrl, { protocol = "whereby-sfu#v4", incrementAnalyticMetric }) {
|
|
4039
4039
|
super();
|
|
4040
4040
|
this.socket = null;
|
|
4041
|
+
this.incrementAnalyticMetric = incrementAnalyticMetric;
|
|
4041
4042
|
this.wsUrl = wsUrl;
|
|
4042
4043
|
this.protocol = protocol;
|
|
4043
4044
|
this.sents = new Map();
|
|
@@ -4087,9 +4088,16 @@ class VegaConnection extends EventEmitter.EventEmitter {
|
|
|
4087
4088
|
logger$3.info("Error", error);
|
|
4088
4089
|
}
|
|
4089
4090
|
_handleResponse(socketMessage) {
|
|
4091
|
+
var _a;
|
|
4090
4092
|
const sent = this.sents.get(socketMessage.id);
|
|
4091
4093
|
if (!sent) {
|
|
4092
4094
|
logger$3.warn(`Received unknown message with id ${socketMessage.id} from SFU.`);
|
|
4095
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaUnknownResponse");
|
|
4096
|
+
rtcStats.sendEvent("VegaUnknownResponse", {
|
|
4097
|
+
id: socketMessage.id,
|
|
4098
|
+
code: socketMessage.errorCode,
|
|
4099
|
+
reason: socketMessage.errorReason,
|
|
4100
|
+
});
|
|
4093
4101
|
return;
|
|
4094
4102
|
}
|
|
4095
4103
|
if (socketMessage.ok) {
|
|
@@ -4132,6 +4140,12 @@ class VegaConnection extends EventEmitter.EventEmitter {
|
|
|
4132
4140
|
pReject(error);
|
|
4133
4141
|
},
|
|
4134
4142
|
timer: setTimeout(() => {
|
|
4143
|
+
var _a;
|
|
4144
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaRequestTimeout");
|
|
4145
|
+
rtcStats.sendEvent("VegaRequestTimeout", {
|
|
4146
|
+
id: request.id,
|
|
4147
|
+
method: request.method,
|
|
4148
|
+
});
|
|
4135
4149
|
if (!this.sents.delete(request.id))
|
|
4136
4150
|
return;
|
|
4137
4151
|
pReject(new Error("request timeout"));
|
|
@@ -4172,7 +4186,7 @@ function createVegaConnectionManager(config) {
|
|
|
4172
4186
|
};
|
|
4173
4187
|
let connectionAttemptInProgress = false;
|
|
4174
4188
|
let hasPendingConnectionAttempt = false;
|
|
4175
|
-
const connect = () => {
|
|
4189
|
+
const connect = (incrementAnalyticMetric) => {
|
|
4176
4190
|
if (connectionAttemptInProgress) {
|
|
4177
4191
|
hasPendingConnectionAttempt = true;
|
|
4178
4192
|
return;
|
|
@@ -4236,7 +4250,10 @@ function createVegaConnectionManager(config) {
|
|
|
4236
4250
|
});
|
|
4237
4251
|
return;
|
|
4238
4252
|
}
|
|
4239
|
-
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host
|
|
4253
|
+
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host, {
|
|
4254
|
+
protocol: "whereby-sfu#v4",
|
|
4255
|
+
incrementAnalyticMetric,
|
|
4256
|
+
});
|
|
4240
4257
|
let wasClosed = false;
|
|
4241
4258
|
vegaConnection.on("open", () => {
|
|
4242
4259
|
setTimeout(() => {
|
|
@@ -4410,6 +4427,8 @@ class VegaRtcManager {
|
|
|
4410
4427
|
this._networkIsDetectedUpBySignal = false;
|
|
4411
4428
|
this._cpuOveruseDetected = false;
|
|
4412
4429
|
this.analytics = {
|
|
4430
|
+
vegaRequestTimeout: 0,
|
|
4431
|
+
vegaUnknownResponse: 0,
|
|
4413
4432
|
vegaJoinFailed: 0,
|
|
4414
4433
|
vegaJoinWithoutVegaConnection: 0,
|
|
4415
4434
|
vegaCreateTransportWithoutVegaConnection: 0,
|
|
@@ -4545,7 +4564,7 @@ class VegaRtcManager {
|
|
|
4545
4564
|
},
|
|
4546
4565
|
});
|
|
4547
4566
|
}
|
|
4548
|
-
this._vegaConnectionManager.connect();
|
|
4567
|
+
this._vegaConnectionManager.connect((metric) => this.analytics[metric]++);
|
|
4549
4568
|
this._isConnectingOrConnected = true;
|
|
4550
4569
|
}
|
|
4551
4570
|
_onClose() {
|
|
@@ -6614,7 +6633,7 @@ class BandwidthTester extends EventEmitter {
|
|
|
6614
6633
|
this._startTime = Date.now();
|
|
6615
6634
|
const host = this._features.sfuServerOverrideHost || "any.sfu.svc.whereby.com";
|
|
6616
6635
|
const wsUrl = `wss://${host}`;
|
|
6617
|
-
this._vegaConnection = new VegaConnection(wsUrl, "whereby-sfu#bw-test-v1");
|
|
6636
|
+
this._vegaConnection = new VegaConnection(wsUrl, { protocol: "whereby-sfu#bw-test-v1" });
|
|
6618
6637
|
this._vegaConnection.on("open", () => this._start());
|
|
6619
6638
|
this._vegaConnection.on("close", () => this.close(true));
|
|
6620
6639
|
this._vegaConnection.on("message", (message) => this._onMessage(message));
|
package/dist/index.d.cts
CHANGED
|
@@ -382,6 +382,40 @@ declare function sortCodecs(codecs: Codec[], features: {
|
|
|
382
382
|
av1On?: boolean;
|
|
383
383
|
}): Promise<Codec[]>;
|
|
384
384
|
|
|
385
|
+
type VegaTransportDirection = "send" | "recv";
|
|
386
|
+
|
|
387
|
+
type VegaAnalytics = {
|
|
388
|
+
vegaUnknownResponse: number;
|
|
389
|
+
vegaRequestTimeout: number;
|
|
390
|
+
vegaJoinFailed: number;
|
|
391
|
+
vegaJoinWithoutVegaConnection: number;
|
|
392
|
+
vegaCreateTransportWithoutVegaConnection: number;
|
|
393
|
+
vegaIceRestarts: number;
|
|
394
|
+
vegaIceRestartMissingTransport: number;
|
|
395
|
+
vegaIceRestartWrongTransportId: number;
|
|
396
|
+
vegaNonErrorRejectionValueGUMError: number;
|
|
397
|
+
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
398
|
+
micTrackEndedCount: number;
|
|
399
|
+
camTrackEndedCount: number;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
403
|
+
|
|
404
|
+
type VegaIncrementAnalyticMetric = (metric: VegaAnalyticMetric) => void;
|
|
405
|
+
|
|
406
|
+
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
407
|
+
|
|
408
|
+
type ClientState = {
|
|
409
|
+
hasAcceptedWebcamStream: Boolean;
|
|
410
|
+
hasAcceptedScreenStream: Boolean;
|
|
411
|
+
hasEmittedWebcamStream: Boolean;
|
|
412
|
+
hasEmittedScreenStream: Boolean;
|
|
413
|
+
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
414
|
+
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
415
|
+
screenShareStreamId?: string;
|
|
416
|
+
camStreamId?: string;
|
|
417
|
+
};
|
|
418
|
+
|
|
385
419
|
declare enum RtcEventNames {
|
|
386
420
|
rtc_manager_created = "rtc_manager_created",
|
|
387
421
|
stream_added = "stream_added"
|
|
@@ -400,6 +434,10 @@ interface RtcManagerOptions {
|
|
|
400
434
|
interface VegaRtcManagerOptions extends RtcManagerOptions {
|
|
401
435
|
eventClaim: string;
|
|
402
436
|
}
|
|
437
|
+
interface VegaConnectionOptions {
|
|
438
|
+
protocol?: string;
|
|
439
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
440
|
+
}
|
|
403
441
|
interface RtcManager {
|
|
404
442
|
acceptNewStream: ({ clientId, streamId }: {
|
|
405
443
|
clientId: string;
|
|
@@ -1476,7 +1514,8 @@ declare class VegaConnection extends EventEmitter$1 {
|
|
|
1476
1514
|
protocol: string;
|
|
1477
1515
|
socket: WebSocket | null;
|
|
1478
1516
|
sents: Map<any, any>;
|
|
1479
|
-
|
|
1517
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
1518
|
+
constructor(wsUrl: string, { protocol, incrementAnalyticMetric }: VegaConnectionOptions);
|
|
1480
1519
|
_setupSocket(): void;
|
|
1481
1520
|
_tearDown(): void;
|
|
1482
1521
|
close(): void;
|
|
@@ -1578,40 +1617,12 @@ declare function createVegaConnectionManager(config: {
|
|
|
1578
1617
|
onDisconnected?: () => void;
|
|
1579
1618
|
onFailed?: () => void;
|
|
1580
1619
|
}): {
|
|
1581
|
-
connect: () => void;
|
|
1620
|
+
connect: (incrementAnalyticMetric?: VegaIncrementAnalyticMetric) => void;
|
|
1582
1621
|
updateHostList: (updatedHostList: string | HostListEntryOptionalDC[]) => void;
|
|
1583
1622
|
networkIsUp: () => void;
|
|
1584
1623
|
networkIsPossiblyDown: () => void;
|
|
1585
1624
|
};
|
|
1586
1625
|
|
|
1587
|
-
type VegaTransportDirection = "send" | "recv";
|
|
1588
|
-
|
|
1589
|
-
type VegaAnalytics = {
|
|
1590
|
-
vegaJoinFailed: number;
|
|
1591
|
-
vegaJoinWithoutVegaConnection: number;
|
|
1592
|
-
vegaCreateTransportWithoutVegaConnection: number;
|
|
1593
|
-
vegaIceRestarts: number;
|
|
1594
|
-
vegaIceRestartMissingTransport: number;
|
|
1595
|
-
vegaIceRestartWrongTransportId: number;
|
|
1596
|
-
vegaNonErrorRejectionValueGUMError: number;
|
|
1597
|
-
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
1598
|
-
micTrackEndedCount: number;
|
|
1599
|
-
camTrackEndedCount: number;
|
|
1600
|
-
};
|
|
1601
|
-
|
|
1602
|
-
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
1603
|
-
|
|
1604
|
-
type ClientState = {
|
|
1605
|
-
hasAcceptedWebcamStream: Boolean;
|
|
1606
|
-
hasAcceptedScreenStream: Boolean;
|
|
1607
|
-
hasEmittedWebcamStream: Boolean;
|
|
1608
|
-
hasEmittedScreenStream: Boolean;
|
|
1609
|
-
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
1610
|
-
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
1611
|
-
screenShareStreamId?: string;
|
|
1612
|
-
camStreamId?: string;
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
1626
|
declare class VegaRtcManager implements RtcManager {
|
|
1616
1627
|
_selfId: any;
|
|
1617
1628
|
_room: any;
|
|
@@ -1947,4 +1958,4 @@ declare const STREAM_TYPES: {
|
|
|
1947
1958
|
};
|
|
1948
1959
|
|
|
1949
1960
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1950
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1961
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.mts
CHANGED
|
@@ -382,6 +382,40 @@ declare function sortCodecs(codecs: Codec[], features: {
|
|
|
382
382
|
av1On?: boolean;
|
|
383
383
|
}): Promise<Codec[]>;
|
|
384
384
|
|
|
385
|
+
type VegaTransportDirection = "send" | "recv";
|
|
386
|
+
|
|
387
|
+
type VegaAnalytics = {
|
|
388
|
+
vegaUnknownResponse: number;
|
|
389
|
+
vegaRequestTimeout: number;
|
|
390
|
+
vegaJoinFailed: number;
|
|
391
|
+
vegaJoinWithoutVegaConnection: number;
|
|
392
|
+
vegaCreateTransportWithoutVegaConnection: number;
|
|
393
|
+
vegaIceRestarts: number;
|
|
394
|
+
vegaIceRestartMissingTransport: number;
|
|
395
|
+
vegaIceRestartWrongTransportId: number;
|
|
396
|
+
vegaNonErrorRejectionValueGUMError: number;
|
|
397
|
+
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
398
|
+
micTrackEndedCount: number;
|
|
399
|
+
camTrackEndedCount: number;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
403
|
+
|
|
404
|
+
type VegaIncrementAnalyticMetric = (metric: VegaAnalyticMetric) => void;
|
|
405
|
+
|
|
406
|
+
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
407
|
+
|
|
408
|
+
type ClientState = {
|
|
409
|
+
hasAcceptedWebcamStream: Boolean;
|
|
410
|
+
hasAcceptedScreenStream: Boolean;
|
|
411
|
+
hasEmittedWebcamStream: Boolean;
|
|
412
|
+
hasEmittedScreenStream: Boolean;
|
|
413
|
+
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
414
|
+
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
415
|
+
screenShareStreamId?: string;
|
|
416
|
+
camStreamId?: string;
|
|
417
|
+
};
|
|
418
|
+
|
|
385
419
|
declare enum RtcEventNames {
|
|
386
420
|
rtc_manager_created = "rtc_manager_created",
|
|
387
421
|
stream_added = "stream_added"
|
|
@@ -400,6 +434,10 @@ interface RtcManagerOptions {
|
|
|
400
434
|
interface VegaRtcManagerOptions extends RtcManagerOptions {
|
|
401
435
|
eventClaim: string;
|
|
402
436
|
}
|
|
437
|
+
interface VegaConnectionOptions {
|
|
438
|
+
protocol?: string;
|
|
439
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
440
|
+
}
|
|
403
441
|
interface RtcManager {
|
|
404
442
|
acceptNewStream: ({ clientId, streamId }: {
|
|
405
443
|
clientId: string;
|
|
@@ -1476,7 +1514,8 @@ declare class VegaConnection extends EventEmitter$1 {
|
|
|
1476
1514
|
protocol: string;
|
|
1477
1515
|
socket: WebSocket | null;
|
|
1478
1516
|
sents: Map<any, any>;
|
|
1479
|
-
|
|
1517
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
1518
|
+
constructor(wsUrl: string, { protocol, incrementAnalyticMetric }: VegaConnectionOptions);
|
|
1480
1519
|
_setupSocket(): void;
|
|
1481
1520
|
_tearDown(): void;
|
|
1482
1521
|
close(): void;
|
|
@@ -1578,40 +1617,12 @@ declare function createVegaConnectionManager(config: {
|
|
|
1578
1617
|
onDisconnected?: () => void;
|
|
1579
1618
|
onFailed?: () => void;
|
|
1580
1619
|
}): {
|
|
1581
|
-
connect: () => void;
|
|
1620
|
+
connect: (incrementAnalyticMetric?: VegaIncrementAnalyticMetric) => void;
|
|
1582
1621
|
updateHostList: (updatedHostList: string | HostListEntryOptionalDC[]) => void;
|
|
1583
1622
|
networkIsUp: () => void;
|
|
1584
1623
|
networkIsPossiblyDown: () => void;
|
|
1585
1624
|
};
|
|
1586
1625
|
|
|
1587
|
-
type VegaTransportDirection = "send" | "recv";
|
|
1588
|
-
|
|
1589
|
-
type VegaAnalytics = {
|
|
1590
|
-
vegaJoinFailed: number;
|
|
1591
|
-
vegaJoinWithoutVegaConnection: number;
|
|
1592
|
-
vegaCreateTransportWithoutVegaConnection: number;
|
|
1593
|
-
vegaIceRestarts: number;
|
|
1594
|
-
vegaIceRestartMissingTransport: number;
|
|
1595
|
-
vegaIceRestartWrongTransportId: number;
|
|
1596
|
-
vegaNonErrorRejectionValueGUMError: number;
|
|
1597
|
-
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
1598
|
-
micTrackEndedCount: number;
|
|
1599
|
-
camTrackEndedCount: number;
|
|
1600
|
-
};
|
|
1601
|
-
|
|
1602
|
-
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
1603
|
-
|
|
1604
|
-
type ClientState = {
|
|
1605
|
-
hasAcceptedWebcamStream: Boolean;
|
|
1606
|
-
hasAcceptedScreenStream: Boolean;
|
|
1607
|
-
hasEmittedWebcamStream: Boolean;
|
|
1608
|
-
hasEmittedScreenStream: Boolean;
|
|
1609
|
-
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
1610
|
-
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
1611
|
-
screenShareStreamId?: string;
|
|
1612
|
-
camStreamId?: string;
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
1626
|
declare class VegaRtcManager implements RtcManager {
|
|
1616
1627
|
_selfId: any;
|
|
1617
1628
|
_room: any;
|
|
@@ -1947,4 +1958,4 @@ declare const STREAM_TYPES: {
|
|
|
1947
1958
|
};
|
|
1948
1959
|
|
|
1949
1960
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1950
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1961
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -382,6 +382,40 @@ declare function sortCodecs(codecs: Codec[], features: {
|
|
|
382
382
|
av1On?: boolean;
|
|
383
383
|
}): Promise<Codec[]>;
|
|
384
384
|
|
|
385
|
+
type VegaTransportDirection = "send" | "recv";
|
|
386
|
+
|
|
387
|
+
type VegaAnalytics = {
|
|
388
|
+
vegaUnknownResponse: number;
|
|
389
|
+
vegaRequestTimeout: number;
|
|
390
|
+
vegaJoinFailed: number;
|
|
391
|
+
vegaJoinWithoutVegaConnection: number;
|
|
392
|
+
vegaCreateTransportWithoutVegaConnection: number;
|
|
393
|
+
vegaIceRestarts: number;
|
|
394
|
+
vegaIceRestartMissingTransport: number;
|
|
395
|
+
vegaIceRestartWrongTransportId: number;
|
|
396
|
+
vegaNonErrorRejectionValueGUMError: number;
|
|
397
|
+
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
398
|
+
micTrackEndedCount: number;
|
|
399
|
+
camTrackEndedCount: number;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
403
|
+
|
|
404
|
+
type VegaIncrementAnalyticMetric = (metric: VegaAnalyticMetric) => void;
|
|
405
|
+
|
|
406
|
+
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
407
|
+
|
|
408
|
+
type ClientState = {
|
|
409
|
+
hasAcceptedWebcamStream: Boolean;
|
|
410
|
+
hasAcceptedScreenStream: Boolean;
|
|
411
|
+
hasEmittedWebcamStream: Boolean;
|
|
412
|
+
hasEmittedScreenStream: Boolean;
|
|
413
|
+
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
414
|
+
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
415
|
+
screenShareStreamId?: string;
|
|
416
|
+
camStreamId?: string;
|
|
417
|
+
};
|
|
418
|
+
|
|
385
419
|
declare enum RtcEventNames {
|
|
386
420
|
rtc_manager_created = "rtc_manager_created",
|
|
387
421
|
stream_added = "stream_added"
|
|
@@ -400,6 +434,10 @@ interface RtcManagerOptions {
|
|
|
400
434
|
interface VegaRtcManagerOptions extends RtcManagerOptions {
|
|
401
435
|
eventClaim: string;
|
|
402
436
|
}
|
|
437
|
+
interface VegaConnectionOptions {
|
|
438
|
+
protocol?: string;
|
|
439
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
440
|
+
}
|
|
403
441
|
interface RtcManager {
|
|
404
442
|
acceptNewStream: ({ clientId, streamId }: {
|
|
405
443
|
clientId: string;
|
|
@@ -1476,7 +1514,8 @@ declare class VegaConnection extends EventEmitter$1 {
|
|
|
1476
1514
|
protocol: string;
|
|
1477
1515
|
socket: WebSocket | null;
|
|
1478
1516
|
sents: Map<any, any>;
|
|
1479
|
-
|
|
1517
|
+
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
1518
|
+
constructor(wsUrl: string, { protocol, incrementAnalyticMetric }: VegaConnectionOptions);
|
|
1480
1519
|
_setupSocket(): void;
|
|
1481
1520
|
_tearDown(): void;
|
|
1482
1521
|
close(): void;
|
|
@@ -1578,40 +1617,12 @@ declare function createVegaConnectionManager(config: {
|
|
|
1578
1617
|
onDisconnected?: () => void;
|
|
1579
1618
|
onFailed?: () => void;
|
|
1580
1619
|
}): {
|
|
1581
|
-
connect: () => void;
|
|
1620
|
+
connect: (incrementAnalyticMetric?: VegaIncrementAnalyticMetric) => void;
|
|
1582
1621
|
updateHostList: (updatedHostList: string | HostListEntryOptionalDC[]) => void;
|
|
1583
1622
|
networkIsUp: () => void;
|
|
1584
1623
|
networkIsPossiblyDown: () => void;
|
|
1585
1624
|
};
|
|
1586
1625
|
|
|
1587
|
-
type VegaTransportDirection = "send" | "recv";
|
|
1588
|
-
|
|
1589
|
-
type VegaAnalytics = {
|
|
1590
|
-
vegaJoinFailed: number;
|
|
1591
|
-
vegaJoinWithoutVegaConnection: number;
|
|
1592
|
-
vegaCreateTransportWithoutVegaConnection: number;
|
|
1593
|
-
vegaIceRestarts: number;
|
|
1594
|
-
vegaIceRestartMissingTransport: number;
|
|
1595
|
-
vegaIceRestartWrongTransportId: number;
|
|
1596
|
-
vegaNonErrorRejectionValueGUMError: number;
|
|
1597
|
-
vegaReplaceTrackNoProducerNoEnabledTrack: number;
|
|
1598
|
-
micTrackEndedCount: number;
|
|
1599
|
-
camTrackEndedCount: number;
|
|
1600
|
-
};
|
|
1601
|
-
|
|
1602
|
-
type MediaStreamWhichMayHaveInboundId = MediaStream & { inboundId?: string };
|
|
1603
|
-
|
|
1604
|
-
type ClientState = {
|
|
1605
|
-
hasAcceptedWebcamStream: Boolean;
|
|
1606
|
-
hasAcceptedScreenStream: Boolean;
|
|
1607
|
-
hasEmittedWebcamStream: Boolean;
|
|
1608
|
-
hasEmittedScreenStream: Boolean;
|
|
1609
|
-
webcamStream?: MediaStreamWhichMayHaveInboundId;
|
|
1610
|
-
screenStream?: MediaStreamWhichMayHaveInboundId;
|
|
1611
|
-
screenShareStreamId?: string;
|
|
1612
|
-
camStreamId?: string;
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
1626
|
declare class VegaRtcManager implements RtcManager {
|
|
1616
1627
|
_selfId: any;
|
|
1617
1628
|
_room: any;
|
|
@@ -1947,4 +1958,4 @@ declare const STREAM_TYPES: {
|
|
|
1947
1958
|
};
|
|
1948
1959
|
|
|
1949
1960
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1950
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1961
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -4014,9 +4014,10 @@ class SfuV2Parser {
|
|
|
4014
4014
|
|
|
4015
4015
|
const logger$3 = new Logger();
|
|
4016
4016
|
class VegaConnection extends EventEmitter$1 {
|
|
4017
|
-
constructor(wsUrl, protocol = "whereby-sfu#v4") {
|
|
4017
|
+
constructor(wsUrl, { protocol = "whereby-sfu#v4", incrementAnalyticMetric }) {
|
|
4018
4018
|
super();
|
|
4019
4019
|
this.socket = null;
|
|
4020
|
+
this.incrementAnalyticMetric = incrementAnalyticMetric;
|
|
4020
4021
|
this.wsUrl = wsUrl;
|
|
4021
4022
|
this.protocol = protocol;
|
|
4022
4023
|
this.sents = new Map();
|
|
@@ -4066,9 +4067,16 @@ class VegaConnection extends EventEmitter$1 {
|
|
|
4066
4067
|
logger$3.info("Error", error);
|
|
4067
4068
|
}
|
|
4068
4069
|
_handleResponse(socketMessage) {
|
|
4070
|
+
var _a;
|
|
4069
4071
|
const sent = this.sents.get(socketMessage.id);
|
|
4070
4072
|
if (!sent) {
|
|
4071
4073
|
logger$3.warn(`Received unknown message with id ${socketMessage.id} from SFU.`);
|
|
4074
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaUnknownResponse");
|
|
4075
|
+
rtcStats.sendEvent("VegaUnknownResponse", {
|
|
4076
|
+
id: socketMessage.id,
|
|
4077
|
+
code: socketMessage.errorCode,
|
|
4078
|
+
reason: socketMessage.errorReason,
|
|
4079
|
+
});
|
|
4072
4080
|
return;
|
|
4073
4081
|
}
|
|
4074
4082
|
if (socketMessage.ok) {
|
|
@@ -4111,6 +4119,12 @@ class VegaConnection extends EventEmitter$1 {
|
|
|
4111
4119
|
pReject(error);
|
|
4112
4120
|
},
|
|
4113
4121
|
timer: setTimeout(() => {
|
|
4122
|
+
var _a;
|
|
4123
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaRequestTimeout");
|
|
4124
|
+
rtcStats.sendEvent("VegaRequestTimeout", {
|
|
4125
|
+
id: request.id,
|
|
4126
|
+
method: request.method,
|
|
4127
|
+
});
|
|
4114
4128
|
if (!this.sents.delete(request.id))
|
|
4115
4129
|
return;
|
|
4116
4130
|
pReject(new Error("request timeout"));
|
|
@@ -4151,7 +4165,7 @@ function createVegaConnectionManager(config) {
|
|
|
4151
4165
|
};
|
|
4152
4166
|
let connectionAttemptInProgress = false;
|
|
4153
4167
|
let hasPendingConnectionAttempt = false;
|
|
4154
|
-
const connect = () => {
|
|
4168
|
+
const connect = (incrementAnalyticMetric) => {
|
|
4155
4169
|
if (connectionAttemptInProgress) {
|
|
4156
4170
|
hasPendingConnectionAttempt = true;
|
|
4157
4171
|
return;
|
|
@@ -4215,7 +4229,10 @@ function createVegaConnectionManager(config) {
|
|
|
4215
4229
|
});
|
|
4216
4230
|
return;
|
|
4217
4231
|
}
|
|
4218
|
-
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host
|
|
4232
|
+
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host, {
|
|
4233
|
+
protocol: "whereby-sfu#v4",
|
|
4234
|
+
incrementAnalyticMetric,
|
|
4235
|
+
});
|
|
4219
4236
|
let wasClosed = false;
|
|
4220
4237
|
vegaConnection.on("open", () => {
|
|
4221
4238
|
setTimeout(() => {
|
|
@@ -4389,6 +4406,8 @@ class VegaRtcManager {
|
|
|
4389
4406
|
this._networkIsDetectedUpBySignal = false;
|
|
4390
4407
|
this._cpuOveruseDetected = false;
|
|
4391
4408
|
this.analytics = {
|
|
4409
|
+
vegaRequestTimeout: 0,
|
|
4410
|
+
vegaUnknownResponse: 0,
|
|
4392
4411
|
vegaJoinFailed: 0,
|
|
4393
4412
|
vegaJoinWithoutVegaConnection: 0,
|
|
4394
4413
|
vegaCreateTransportWithoutVegaConnection: 0,
|
|
@@ -4524,7 +4543,7 @@ class VegaRtcManager {
|
|
|
4524
4543
|
},
|
|
4525
4544
|
});
|
|
4526
4545
|
}
|
|
4527
|
-
this._vegaConnectionManager.connect();
|
|
4546
|
+
this._vegaConnectionManager.connect((metric) => this.analytics[metric]++);
|
|
4528
4547
|
this._isConnectingOrConnected = true;
|
|
4529
4548
|
}
|
|
4530
4549
|
_onClose() {
|
|
@@ -6593,7 +6612,7 @@ class BandwidthTester extends EventEmitter {
|
|
|
6593
6612
|
this._startTime = Date.now();
|
|
6594
6613
|
const host = this._features.sfuServerOverrideHost || "any.sfu.svc.whereby.com";
|
|
6595
6614
|
const wsUrl = `wss://${host}`;
|
|
6596
|
-
this._vegaConnection = new VegaConnection(wsUrl, "whereby-sfu#bw-test-v1");
|
|
6615
|
+
this._vegaConnection = new VegaConnection(wsUrl, { protocol: "whereby-sfu#bw-test-v1" });
|
|
6597
6616
|
this._vegaConnection.on("open", () => this._start());
|
|
6598
6617
|
this._vegaConnection.on("close", () => this.close(true));
|
|
6599
6618
|
this._vegaConnection.on("message", (message) => this._onMessage(message));
|
package/dist/legacy-esm.js
CHANGED
|
@@ -4014,9 +4014,10 @@ class SfuV2Parser {
|
|
|
4014
4014
|
|
|
4015
4015
|
const logger$3 = new Logger();
|
|
4016
4016
|
class VegaConnection extends EventEmitter$1 {
|
|
4017
|
-
constructor(wsUrl, protocol = "whereby-sfu#v4") {
|
|
4017
|
+
constructor(wsUrl, { protocol = "whereby-sfu#v4", incrementAnalyticMetric }) {
|
|
4018
4018
|
super();
|
|
4019
4019
|
this.socket = null;
|
|
4020
|
+
this.incrementAnalyticMetric = incrementAnalyticMetric;
|
|
4020
4021
|
this.wsUrl = wsUrl;
|
|
4021
4022
|
this.protocol = protocol;
|
|
4022
4023
|
this.sents = new Map();
|
|
@@ -4066,9 +4067,16 @@ class VegaConnection extends EventEmitter$1 {
|
|
|
4066
4067
|
logger$3.info("Error", error);
|
|
4067
4068
|
}
|
|
4068
4069
|
_handleResponse(socketMessage) {
|
|
4070
|
+
var _a;
|
|
4069
4071
|
const sent = this.sents.get(socketMessage.id);
|
|
4070
4072
|
if (!sent) {
|
|
4071
4073
|
logger$3.warn(`Received unknown message with id ${socketMessage.id} from SFU.`);
|
|
4074
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaUnknownResponse");
|
|
4075
|
+
rtcStats.sendEvent("VegaUnknownResponse", {
|
|
4076
|
+
id: socketMessage.id,
|
|
4077
|
+
code: socketMessage.errorCode,
|
|
4078
|
+
reason: socketMessage.errorReason,
|
|
4079
|
+
});
|
|
4072
4080
|
return;
|
|
4073
4081
|
}
|
|
4074
4082
|
if (socketMessage.ok) {
|
|
@@ -4111,6 +4119,12 @@ class VegaConnection extends EventEmitter$1 {
|
|
|
4111
4119
|
pReject(error);
|
|
4112
4120
|
},
|
|
4113
4121
|
timer: setTimeout(() => {
|
|
4122
|
+
var _a;
|
|
4123
|
+
(_a = this.incrementAnalyticMetric) === null || _a === void 0 ? void 0 : _a.call(this, "vegaRequestTimeout");
|
|
4124
|
+
rtcStats.sendEvent("VegaRequestTimeout", {
|
|
4125
|
+
id: request.id,
|
|
4126
|
+
method: request.method,
|
|
4127
|
+
});
|
|
4114
4128
|
if (!this.sents.delete(request.id))
|
|
4115
4129
|
return;
|
|
4116
4130
|
pReject(new Error("request timeout"));
|
|
@@ -4151,7 +4165,7 @@ function createVegaConnectionManager(config) {
|
|
|
4151
4165
|
};
|
|
4152
4166
|
let connectionAttemptInProgress = false;
|
|
4153
4167
|
let hasPendingConnectionAttempt = false;
|
|
4154
|
-
const connect = () => {
|
|
4168
|
+
const connect = (incrementAnalyticMetric) => {
|
|
4155
4169
|
if (connectionAttemptInProgress) {
|
|
4156
4170
|
hasPendingConnectionAttempt = true;
|
|
4157
4171
|
return;
|
|
@@ -4215,7 +4229,10 @@ function createVegaConnectionManager(config) {
|
|
|
4215
4229
|
});
|
|
4216
4230
|
return;
|
|
4217
4231
|
}
|
|
4218
|
-
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host
|
|
4232
|
+
const vegaConnection = new VegaConnection(((_a = config.getUrlForHost) === null || _a === void 0 ? void 0 : _a.call(config, host)) || host, {
|
|
4233
|
+
protocol: "whereby-sfu#v4",
|
|
4234
|
+
incrementAnalyticMetric,
|
|
4235
|
+
});
|
|
4219
4236
|
let wasClosed = false;
|
|
4220
4237
|
vegaConnection.on("open", () => {
|
|
4221
4238
|
setTimeout(() => {
|
|
@@ -4389,6 +4406,8 @@ class VegaRtcManager {
|
|
|
4389
4406
|
this._networkIsDetectedUpBySignal = false;
|
|
4390
4407
|
this._cpuOveruseDetected = false;
|
|
4391
4408
|
this.analytics = {
|
|
4409
|
+
vegaRequestTimeout: 0,
|
|
4410
|
+
vegaUnknownResponse: 0,
|
|
4392
4411
|
vegaJoinFailed: 0,
|
|
4393
4412
|
vegaJoinWithoutVegaConnection: 0,
|
|
4394
4413
|
vegaCreateTransportWithoutVegaConnection: 0,
|
|
@@ -4524,7 +4543,7 @@ class VegaRtcManager {
|
|
|
4524
4543
|
},
|
|
4525
4544
|
});
|
|
4526
4545
|
}
|
|
4527
|
-
this._vegaConnectionManager.connect();
|
|
4546
|
+
this._vegaConnectionManager.connect((metric) => this.analytics[metric]++);
|
|
4528
4547
|
this._isConnectingOrConnected = true;
|
|
4529
4548
|
}
|
|
4530
4549
|
_onClose() {
|
|
@@ -6593,7 +6612,7 @@ class BandwidthTester extends EventEmitter {
|
|
|
6593
6612
|
this._startTime = Date.now();
|
|
6594
6613
|
const host = this._features.sfuServerOverrideHost || "any.sfu.svc.whereby.com";
|
|
6595
6614
|
const wsUrl = `wss://${host}`;
|
|
6596
|
-
this._vegaConnection = new VegaConnection(wsUrl, "whereby-sfu#bw-test-v1");
|
|
6615
|
+
this._vegaConnection = new VegaConnection(wsUrl, { protocol: "whereby-sfu#bw-test-v1" });
|
|
6597
6616
|
this._vegaConnection.on("open", () => this._start());
|
|
6598
6617
|
this._vegaConnection.on("close", () => this.close(true));
|
|
6599
6618
|
this._vegaConnection.on("message", (message) => this._onMessage(message));
|