@whereby.com/media 9.5.0 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +42 -1
- package/dist/index.d.cts +29 -1
- package/dist/index.d.mts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.mjs +42 -1
- package/dist/legacy-esm.js +42 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4486,6 +4486,13 @@ class VegaRtcManager {
|
|
|
4486
4486
|
});
|
|
4487
4487
|
this._networkIsDetectedUpBySignal = false;
|
|
4488
4488
|
this._cpuOveruseDetected = false;
|
|
4489
|
+
this._sfuZombie = {
|
|
4490
|
+
offlineDetectedAt: null,
|
|
4491
|
+
onBrowserOffline: () => this._sfuZombieOnOffline(),
|
|
4492
|
+
};
|
|
4493
|
+
if (typeof window !== "undefined") {
|
|
4494
|
+
window.addEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
4495
|
+
}
|
|
4489
4496
|
this.analytics = {
|
|
4490
4497
|
vegaRequestTimeout: 0,
|
|
4491
4498
|
vegaUnknownResponse: 0,
|
|
@@ -4509,6 +4516,9 @@ class VegaRtcManager {
|
|
|
4509
4516
|
numIceConnected: 0,
|
|
4510
4517
|
numIceDisconnected: 0,
|
|
4511
4518
|
numIceFailed: 0,
|
|
4519
|
+
sfuMsFromOfflineToClose: 0,
|
|
4520
|
+
sfuOfflineWhileConnectedCount: 0,
|
|
4521
|
+
sfuOfflineToCloseCount: 0,
|
|
4512
4522
|
};
|
|
4513
4523
|
}
|
|
4514
4524
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4563,6 +4573,32 @@ class VegaRtcManager {
|
|
|
4563
4573
|
(_a = this._vegaConnectionManager) === null || _a === void 0 ? void 0 : _a.networkIsPossiblyDown();
|
|
4564
4574
|
}
|
|
4565
4575
|
}
|
|
4576
|
+
_sfuZombieOnOffline() {
|
|
4577
|
+
var _a, _b, _c, _d;
|
|
4578
|
+
if (!this._isConnectingOrConnected || this._sfuZombie.offlineDetectedAt !== null) {
|
|
4579
|
+
return;
|
|
4580
|
+
}
|
|
4581
|
+
this._sfuZombie.offlineDetectedAt = Date.now();
|
|
4582
|
+
this.analytics.sfuOfflineWhileConnectedCount++;
|
|
4583
|
+
rtcStats.sendEvent("SfuOfflineWhileConnected", {
|
|
4584
|
+
sfuWsReadyState: (_b = (_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.socket) === null || _b === void 0 ? void 0 : _b.readyState,
|
|
4585
|
+
sendTransportState: (_c = this._sendTransport) === null || _c === void 0 ? void 0 : _c.connectionState,
|
|
4586
|
+
recvTransportState: (_d = this._receiveTransport) === null || _d === void 0 ? void 0 : _d.connectionState,
|
|
4587
|
+
});
|
|
4588
|
+
}
|
|
4589
|
+
_sfuZombieReset() {
|
|
4590
|
+
this._sfuZombie.offlineDetectedAt = null;
|
|
4591
|
+
}
|
|
4592
|
+
_sfuZombieOnClose() {
|
|
4593
|
+
let msFromOfflineToClose;
|
|
4594
|
+
if (this._reconnect && this._sfuZombie.offlineDetectedAt !== null) {
|
|
4595
|
+
msFromOfflineToClose = Date.now() - this._sfuZombie.offlineDetectedAt;
|
|
4596
|
+
this.analytics.sfuMsFromOfflineToClose += msFromOfflineToClose;
|
|
4597
|
+
this.analytics.sfuOfflineToCloseCount++;
|
|
4598
|
+
}
|
|
4599
|
+
this._sfuZombieReset();
|
|
4600
|
+
return msFromOfflineToClose;
|
|
4601
|
+
}
|
|
4566
4602
|
setupSocketListeners() {
|
|
4567
4603
|
this._socketListenerDeregisterFunctions.push(() => this._clearMediaServersRefresh(), this._serverSocket.on(PROTOCOL_RESPONSES.MEDIASERVER_CONFIG, (data) => {
|
|
4568
4604
|
if (data.error) {
|
|
@@ -4659,7 +4695,8 @@ class VegaRtcManager {
|
|
|
4659
4695
|
}
|
|
4660
4696
|
this._qualityMonitor.close();
|
|
4661
4697
|
this._emitToPWA(rtcManagerEvents.SFU_CONNECTION_CLOSED);
|
|
4662
|
-
|
|
4698
|
+
const msFromOfflineToClose = this._sfuZombieOnClose();
|
|
4699
|
+
rtcStats.sendEvent("SfuConnectionClosed", { msFromOfflineToClose });
|
|
4663
4700
|
}
|
|
4664
4701
|
_join() {
|
|
4665
4702
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5639,6 +5676,10 @@ class VegaRtcManager {
|
|
|
5639
5676
|
clearTimeout(this._reconnectTimeOut);
|
|
5640
5677
|
this._reconnectTimeOut = null;
|
|
5641
5678
|
}
|
|
5679
|
+
this._sfuZombieReset();
|
|
5680
|
+
if (typeof window !== "undefined") {
|
|
5681
|
+
window.removeEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
5682
|
+
}
|
|
5642
5683
|
this._socketListenerDeregisterFunctions.forEach((func) => {
|
|
5643
5684
|
func();
|
|
5644
5685
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -449,6 +449,9 @@ type VegaAnalytics = {
|
|
|
449
449
|
numIceConnected: number;
|
|
450
450
|
numIceDisconnected: number;
|
|
451
451
|
numIceFailed: number;
|
|
452
|
+
sfuMsFromOfflineToClose: number;
|
|
453
|
+
sfuOfflineWhileConnectedCount: number;
|
|
454
|
+
sfuOfflineToCloseCount: number;
|
|
452
455
|
};
|
|
453
456
|
|
|
454
457
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -1223,6 +1226,23 @@ interface AddSpotlightRequest {
|
|
|
1223
1226
|
clientId: string;
|
|
1224
1227
|
streamId: string;
|
|
1225
1228
|
}
|
|
1229
|
+
interface BreakoutSessionUpdateRequest {
|
|
1230
|
+
active?: boolean;
|
|
1231
|
+
assignments?: {
|
|
1232
|
+
[deviceId: string]: string;
|
|
1233
|
+
} | null;
|
|
1234
|
+
groups?: {
|
|
1235
|
+
[groupId: string]: string;
|
|
1236
|
+
} | null;
|
|
1237
|
+
enforceAssignment?: boolean;
|
|
1238
|
+
autoMoveToGroup?: boolean;
|
|
1239
|
+
autoMoveToMain?: boolean;
|
|
1240
|
+
moveToGroupGracePeriod?: number | null;
|
|
1241
|
+
moveToMainGracePeriod?: number | null;
|
|
1242
|
+
breakoutTimerSetting?: boolean;
|
|
1243
|
+
breakoutTimerDuration?: number;
|
|
1244
|
+
breakoutNotification?: string | null;
|
|
1245
|
+
}
|
|
1226
1246
|
interface RemoveSpotlightRequest {
|
|
1227
1247
|
clientId: string;
|
|
1228
1248
|
streamId: string;
|
|
@@ -1245,6 +1265,7 @@ interface SignalRequests {
|
|
|
1245
1265
|
join_breakout_group: {
|
|
1246
1266
|
group: string;
|
|
1247
1267
|
};
|
|
1268
|
+
update_breakout_session: BreakoutSessionUpdateRequest;
|
|
1248
1269
|
join_room: JoinRoomRequest;
|
|
1249
1270
|
knock_room: KnockRoomRequest;
|
|
1250
1271
|
leave_room: void;
|
|
@@ -2007,12 +2028,19 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2007
2028
|
_vegaConnectionManager?: ReturnType<typeof createVegaConnectionManager>;
|
|
2008
2029
|
_networkIsDetectedUpBySignal: boolean;
|
|
2009
2030
|
_cpuOveruseDetected: boolean;
|
|
2031
|
+
_sfuZombie: {
|
|
2032
|
+
offlineDetectedAt: number | null;
|
|
2033
|
+
onBrowserOffline: any;
|
|
2034
|
+
};
|
|
2010
2035
|
analytics: VegaAnalytics;
|
|
2011
2036
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, eventClaim }: VegaRtcManagerOptions);
|
|
2012
2037
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }: SignalMediaServerConfig): void;
|
|
2013
2038
|
_clearMediaServersRefresh(): void;
|
|
2014
2039
|
_onNetworkIsDetectedUpBySignal(): void;
|
|
2015
2040
|
_onNetworkIsDetectedPossiblyDownBySignal(): void;
|
|
2041
|
+
_sfuZombieOnOffline(): void;
|
|
2042
|
+
_sfuZombieReset(): void;
|
|
2043
|
+
_sfuZombieOnClose(): number | undefined;
|
|
2016
2044
|
setupSocketListeners(): void;
|
|
2017
2045
|
_emitScreenshareStarted(): void;
|
|
2018
2046
|
_connect(): void;
|
|
@@ -2126,4 +2154,4 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2126
2154
|
}
|
|
2127
2155
|
|
|
2128
2156
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, FILE_SHARE_ERROR_CODES, 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, isFileShareError, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
|
|
2129
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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 };
|
|
2157
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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
|
@@ -449,6 +449,9 @@ type VegaAnalytics = {
|
|
|
449
449
|
numIceConnected: number;
|
|
450
450
|
numIceDisconnected: number;
|
|
451
451
|
numIceFailed: number;
|
|
452
|
+
sfuMsFromOfflineToClose: number;
|
|
453
|
+
sfuOfflineWhileConnectedCount: number;
|
|
454
|
+
sfuOfflineToCloseCount: number;
|
|
452
455
|
};
|
|
453
456
|
|
|
454
457
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -1223,6 +1226,23 @@ interface AddSpotlightRequest {
|
|
|
1223
1226
|
clientId: string;
|
|
1224
1227
|
streamId: string;
|
|
1225
1228
|
}
|
|
1229
|
+
interface BreakoutSessionUpdateRequest {
|
|
1230
|
+
active?: boolean;
|
|
1231
|
+
assignments?: {
|
|
1232
|
+
[deviceId: string]: string;
|
|
1233
|
+
} | null;
|
|
1234
|
+
groups?: {
|
|
1235
|
+
[groupId: string]: string;
|
|
1236
|
+
} | null;
|
|
1237
|
+
enforceAssignment?: boolean;
|
|
1238
|
+
autoMoveToGroup?: boolean;
|
|
1239
|
+
autoMoveToMain?: boolean;
|
|
1240
|
+
moveToGroupGracePeriod?: number | null;
|
|
1241
|
+
moveToMainGracePeriod?: number | null;
|
|
1242
|
+
breakoutTimerSetting?: boolean;
|
|
1243
|
+
breakoutTimerDuration?: number;
|
|
1244
|
+
breakoutNotification?: string | null;
|
|
1245
|
+
}
|
|
1226
1246
|
interface RemoveSpotlightRequest {
|
|
1227
1247
|
clientId: string;
|
|
1228
1248
|
streamId: string;
|
|
@@ -1245,6 +1265,7 @@ interface SignalRequests {
|
|
|
1245
1265
|
join_breakout_group: {
|
|
1246
1266
|
group: string;
|
|
1247
1267
|
};
|
|
1268
|
+
update_breakout_session: BreakoutSessionUpdateRequest;
|
|
1248
1269
|
join_room: JoinRoomRequest;
|
|
1249
1270
|
knock_room: KnockRoomRequest;
|
|
1250
1271
|
leave_room: void;
|
|
@@ -2007,12 +2028,19 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2007
2028
|
_vegaConnectionManager?: ReturnType<typeof createVegaConnectionManager>;
|
|
2008
2029
|
_networkIsDetectedUpBySignal: boolean;
|
|
2009
2030
|
_cpuOveruseDetected: boolean;
|
|
2031
|
+
_sfuZombie: {
|
|
2032
|
+
offlineDetectedAt: number | null;
|
|
2033
|
+
onBrowserOffline: any;
|
|
2034
|
+
};
|
|
2010
2035
|
analytics: VegaAnalytics;
|
|
2011
2036
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, eventClaim }: VegaRtcManagerOptions);
|
|
2012
2037
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }: SignalMediaServerConfig): void;
|
|
2013
2038
|
_clearMediaServersRefresh(): void;
|
|
2014
2039
|
_onNetworkIsDetectedUpBySignal(): void;
|
|
2015
2040
|
_onNetworkIsDetectedPossiblyDownBySignal(): void;
|
|
2041
|
+
_sfuZombieOnOffline(): void;
|
|
2042
|
+
_sfuZombieReset(): void;
|
|
2043
|
+
_sfuZombieOnClose(): number | undefined;
|
|
2016
2044
|
setupSocketListeners(): void;
|
|
2017
2045
|
_emitScreenshareStarted(): void;
|
|
2018
2046
|
_connect(): void;
|
|
@@ -2126,4 +2154,4 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2126
2154
|
}
|
|
2127
2155
|
|
|
2128
2156
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, FILE_SHARE_ERROR_CODES, 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, isFileShareError, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
|
|
2129
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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 };
|
|
2157
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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
|
@@ -449,6 +449,9 @@ type VegaAnalytics = {
|
|
|
449
449
|
numIceConnected: number;
|
|
450
450
|
numIceDisconnected: number;
|
|
451
451
|
numIceFailed: number;
|
|
452
|
+
sfuMsFromOfflineToClose: number;
|
|
453
|
+
sfuOfflineWhileConnectedCount: number;
|
|
454
|
+
sfuOfflineToCloseCount: number;
|
|
452
455
|
};
|
|
453
456
|
|
|
454
457
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -1223,6 +1226,23 @@ interface AddSpotlightRequest {
|
|
|
1223
1226
|
clientId: string;
|
|
1224
1227
|
streamId: string;
|
|
1225
1228
|
}
|
|
1229
|
+
interface BreakoutSessionUpdateRequest {
|
|
1230
|
+
active?: boolean;
|
|
1231
|
+
assignments?: {
|
|
1232
|
+
[deviceId: string]: string;
|
|
1233
|
+
} | null;
|
|
1234
|
+
groups?: {
|
|
1235
|
+
[groupId: string]: string;
|
|
1236
|
+
} | null;
|
|
1237
|
+
enforceAssignment?: boolean;
|
|
1238
|
+
autoMoveToGroup?: boolean;
|
|
1239
|
+
autoMoveToMain?: boolean;
|
|
1240
|
+
moveToGroupGracePeriod?: number | null;
|
|
1241
|
+
moveToMainGracePeriod?: number | null;
|
|
1242
|
+
breakoutTimerSetting?: boolean;
|
|
1243
|
+
breakoutTimerDuration?: number;
|
|
1244
|
+
breakoutNotification?: string | null;
|
|
1245
|
+
}
|
|
1226
1246
|
interface RemoveSpotlightRequest {
|
|
1227
1247
|
clientId: string;
|
|
1228
1248
|
streamId: string;
|
|
@@ -1245,6 +1265,7 @@ interface SignalRequests {
|
|
|
1245
1265
|
join_breakout_group: {
|
|
1246
1266
|
group: string;
|
|
1247
1267
|
};
|
|
1268
|
+
update_breakout_session: BreakoutSessionUpdateRequest;
|
|
1248
1269
|
join_room: JoinRoomRequest;
|
|
1249
1270
|
knock_room: KnockRoomRequest;
|
|
1250
1271
|
leave_room: void;
|
|
@@ -2007,12 +2028,19 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2007
2028
|
_vegaConnectionManager?: ReturnType<typeof createVegaConnectionManager>;
|
|
2008
2029
|
_networkIsDetectedUpBySignal: boolean;
|
|
2009
2030
|
_cpuOveruseDetected: boolean;
|
|
2031
|
+
_sfuZombie: {
|
|
2032
|
+
offlineDetectedAt: number | null;
|
|
2033
|
+
onBrowserOffline: any;
|
|
2034
|
+
};
|
|
2010
2035
|
analytics: VegaAnalytics;
|
|
2011
2036
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, eventClaim }: VegaRtcManagerOptions);
|
|
2012
2037
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }: SignalMediaServerConfig): void;
|
|
2013
2038
|
_clearMediaServersRefresh(): void;
|
|
2014
2039
|
_onNetworkIsDetectedUpBySignal(): void;
|
|
2015
2040
|
_onNetworkIsDetectedPossiblyDownBySignal(): void;
|
|
2041
|
+
_sfuZombieOnOffline(): void;
|
|
2042
|
+
_sfuZombieReset(): void;
|
|
2043
|
+
_sfuZombieOnClose(): number | undefined;
|
|
2016
2044
|
setupSocketListeners(): void;
|
|
2017
2045
|
_emitScreenshareStarted(): void;
|
|
2018
2046
|
_connect(): void;
|
|
@@ -2126,4 +2154,4 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
2126
2154
|
}
|
|
2127
2155
|
|
|
2128
2156
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, FILE_SHARE_ERROR_CODES, 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, isFileShareError, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
|
|
2129
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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 };
|
|
2157
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, 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
|
@@ -4466,6 +4466,13 @@ class VegaRtcManager {
|
|
|
4466
4466
|
});
|
|
4467
4467
|
this._networkIsDetectedUpBySignal = false;
|
|
4468
4468
|
this._cpuOveruseDetected = false;
|
|
4469
|
+
this._sfuZombie = {
|
|
4470
|
+
offlineDetectedAt: null,
|
|
4471
|
+
onBrowserOffline: () => this._sfuZombieOnOffline(),
|
|
4472
|
+
};
|
|
4473
|
+
if (typeof window !== "undefined") {
|
|
4474
|
+
window.addEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
4475
|
+
}
|
|
4469
4476
|
this.analytics = {
|
|
4470
4477
|
vegaRequestTimeout: 0,
|
|
4471
4478
|
vegaUnknownResponse: 0,
|
|
@@ -4489,6 +4496,9 @@ class VegaRtcManager {
|
|
|
4489
4496
|
numIceConnected: 0,
|
|
4490
4497
|
numIceDisconnected: 0,
|
|
4491
4498
|
numIceFailed: 0,
|
|
4499
|
+
sfuMsFromOfflineToClose: 0,
|
|
4500
|
+
sfuOfflineWhileConnectedCount: 0,
|
|
4501
|
+
sfuOfflineToCloseCount: 0,
|
|
4492
4502
|
};
|
|
4493
4503
|
}
|
|
4494
4504
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4543,6 +4553,32 @@ class VegaRtcManager {
|
|
|
4543
4553
|
(_a = this._vegaConnectionManager) === null || _a === void 0 ? void 0 : _a.networkIsPossiblyDown();
|
|
4544
4554
|
}
|
|
4545
4555
|
}
|
|
4556
|
+
_sfuZombieOnOffline() {
|
|
4557
|
+
var _a, _b, _c, _d;
|
|
4558
|
+
if (!this._isConnectingOrConnected || this._sfuZombie.offlineDetectedAt !== null) {
|
|
4559
|
+
return;
|
|
4560
|
+
}
|
|
4561
|
+
this._sfuZombie.offlineDetectedAt = Date.now();
|
|
4562
|
+
this.analytics.sfuOfflineWhileConnectedCount++;
|
|
4563
|
+
rtcStats.sendEvent("SfuOfflineWhileConnected", {
|
|
4564
|
+
sfuWsReadyState: (_b = (_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.socket) === null || _b === void 0 ? void 0 : _b.readyState,
|
|
4565
|
+
sendTransportState: (_c = this._sendTransport) === null || _c === void 0 ? void 0 : _c.connectionState,
|
|
4566
|
+
recvTransportState: (_d = this._receiveTransport) === null || _d === void 0 ? void 0 : _d.connectionState,
|
|
4567
|
+
});
|
|
4568
|
+
}
|
|
4569
|
+
_sfuZombieReset() {
|
|
4570
|
+
this._sfuZombie.offlineDetectedAt = null;
|
|
4571
|
+
}
|
|
4572
|
+
_sfuZombieOnClose() {
|
|
4573
|
+
let msFromOfflineToClose;
|
|
4574
|
+
if (this._reconnect && this._sfuZombie.offlineDetectedAt !== null) {
|
|
4575
|
+
msFromOfflineToClose = Date.now() - this._sfuZombie.offlineDetectedAt;
|
|
4576
|
+
this.analytics.sfuMsFromOfflineToClose += msFromOfflineToClose;
|
|
4577
|
+
this.analytics.sfuOfflineToCloseCount++;
|
|
4578
|
+
}
|
|
4579
|
+
this._sfuZombieReset();
|
|
4580
|
+
return msFromOfflineToClose;
|
|
4581
|
+
}
|
|
4546
4582
|
setupSocketListeners() {
|
|
4547
4583
|
this._socketListenerDeregisterFunctions.push(() => this._clearMediaServersRefresh(), this._serverSocket.on(PROTOCOL_RESPONSES.MEDIASERVER_CONFIG, (data) => {
|
|
4548
4584
|
if (data.error) {
|
|
@@ -4639,7 +4675,8 @@ class VegaRtcManager {
|
|
|
4639
4675
|
}
|
|
4640
4676
|
this._qualityMonitor.close();
|
|
4641
4677
|
this._emitToPWA(rtcManagerEvents.SFU_CONNECTION_CLOSED);
|
|
4642
|
-
|
|
4678
|
+
const msFromOfflineToClose = this._sfuZombieOnClose();
|
|
4679
|
+
rtcStats.sendEvent("SfuConnectionClosed", { msFromOfflineToClose });
|
|
4643
4680
|
}
|
|
4644
4681
|
_join() {
|
|
4645
4682
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5619,6 +5656,10 @@ class VegaRtcManager {
|
|
|
5619
5656
|
clearTimeout(this._reconnectTimeOut);
|
|
5620
5657
|
this._reconnectTimeOut = null;
|
|
5621
5658
|
}
|
|
5659
|
+
this._sfuZombieReset();
|
|
5660
|
+
if (typeof window !== "undefined") {
|
|
5661
|
+
window.removeEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
5662
|
+
}
|
|
5622
5663
|
this._socketListenerDeregisterFunctions.forEach((func) => {
|
|
5623
5664
|
func();
|
|
5624
5665
|
});
|
package/dist/legacy-esm.js
CHANGED
|
@@ -4466,6 +4466,13 @@ class VegaRtcManager {
|
|
|
4466
4466
|
});
|
|
4467
4467
|
this._networkIsDetectedUpBySignal = false;
|
|
4468
4468
|
this._cpuOveruseDetected = false;
|
|
4469
|
+
this._sfuZombie = {
|
|
4470
|
+
offlineDetectedAt: null,
|
|
4471
|
+
onBrowserOffline: () => this._sfuZombieOnOffline(),
|
|
4472
|
+
};
|
|
4473
|
+
if (typeof window !== "undefined") {
|
|
4474
|
+
window.addEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
4475
|
+
}
|
|
4469
4476
|
this.analytics = {
|
|
4470
4477
|
vegaRequestTimeout: 0,
|
|
4471
4478
|
vegaUnknownResponse: 0,
|
|
@@ -4489,6 +4496,9 @@ class VegaRtcManager {
|
|
|
4489
4496
|
numIceConnected: 0,
|
|
4490
4497
|
numIceDisconnected: 0,
|
|
4491
4498
|
numIceFailed: 0,
|
|
4499
|
+
sfuMsFromOfflineToClose: 0,
|
|
4500
|
+
sfuOfflineWhileConnectedCount: 0,
|
|
4501
|
+
sfuOfflineToCloseCount: 0,
|
|
4492
4502
|
};
|
|
4493
4503
|
}
|
|
4494
4504
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4543,6 +4553,32 @@ class VegaRtcManager {
|
|
|
4543
4553
|
(_a = this._vegaConnectionManager) === null || _a === void 0 ? void 0 : _a.networkIsPossiblyDown();
|
|
4544
4554
|
}
|
|
4545
4555
|
}
|
|
4556
|
+
_sfuZombieOnOffline() {
|
|
4557
|
+
var _a, _b, _c, _d;
|
|
4558
|
+
if (!this._isConnectingOrConnected || this._sfuZombie.offlineDetectedAt !== null) {
|
|
4559
|
+
return;
|
|
4560
|
+
}
|
|
4561
|
+
this._sfuZombie.offlineDetectedAt = Date.now();
|
|
4562
|
+
this.analytics.sfuOfflineWhileConnectedCount++;
|
|
4563
|
+
rtcStats.sendEvent("SfuOfflineWhileConnected", {
|
|
4564
|
+
sfuWsReadyState: (_b = (_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.socket) === null || _b === void 0 ? void 0 : _b.readyState,
|
|
4565
|
+
sendTransportState: (_c = this._sendTransport) === null || _c === void 0 ? void 0 : _c.connectionState,
|
|
4566
|
+
recvTransportState: (_d = this._receiveTransport) === null || _d === void 0 ? void 0 : _d.connectionState,
|
|
4567
|
+
});
|
|
4568
|
+
}
|
|
4569
|
+
_sfuZombieReset() {
|
|
4570
|
+
this._sfuZombie.offlineDetectedAt = null;
|
|
4571
|
+
}
|
|
4572
|
+
_sfuZombieOnClose() {
|
|
4573
|
+
let msFromOfflineToClose;
|
|
4574
|
+
if (this._reconnect && this._sfuZombie.offlineDetectedAt !== null) {
|
|
4575
|
+
msFromOfflineToClose = Date.now() - this._sfuZombie.offlineDetectedAt;
|
|
4576
|
+
this.analytics.sfuMsFromOfflineToClose += msFromOfflineToClose;
|
|
4577
|
+
this.analytics.sfuOfflineToCloseCount++;
|
|
4578
|
+
}
|
|
4579
|
+
this._sfuZombieReset();
|
|
4580
|
+
return msFromOfflineToClose;
|
|
4581
|
+
}
|
|
4546
4582
|
setupSocketListeners() {
|
|
4547
4583
|
this._socketListenerDeregisterFunctions.push(() => this._clearMediaServersRefresh(), this._serverSocket.on(PROTOCOL_RESPONSES.MEDIASERVER_CONFIG, (data) => {
|
|
4548
4584
|
if (data.error) {
|
|
@@ -4639,7 +4675,8 @@ class VegaRtcManager {
|
|
|
4639
4675
|
}
|
|
4640
4676
|
this._qualityMonitor.close();
|
|
4641
4677
|
this._emitToPWA(rtcManagerEvents.SFU_CONNECTION_CLOSED);
|
|
4642
|
-
|
|
4678
|
+
const msFromOfflineToClose = this._sfuZombieOnClose();
|
|
4679
|
+
rtcStats.sendEvent("SfuConnectionClosed", { msFromOfflineToClose });
|
|
4643
4680
|
}
|
|
4644
4681
|
_join() {
|
|
4645
4682
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5619,6 +5656,10 @@ class VegaRtcManager {
|
|
|
5619
5656
|
clearTimeout(this._reconnectTimeOut);
|
|
5620
5657
|
this._reconnectTimeOut = null;
|
|
5621
5658
|
}
|
|
5659
|
+
this._sfuZombieReset();
|
|
5660
|
+
if (typeof window !== "undefined") {
|
|
5661
|
+
window.removeEventListener("offline", this._sfuZombie.onBrowserOffline);
|
|
5662
|
+
}
|
|
5622
5663
|
this._socketListenerDeregisterFunctions.forEach((func) => {
|
|
5623
5664
|
func();
|
|
5624
5665
|
});
|