@whereby.com/media 1.17.0 → 1.17.2
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 -7
- package/dist/index.d.cts +8 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +42 -7
- package/dist/legacy-esm.js +42 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -809,9 +809,23 @@ const VIDEO_SETTINGS_VP9 = {
|
|
|
809
809
|
},
|
|
810
810
|
encodings: [{ scalabilityMode: "L3T2_KEY" }],
|
|
811
811
|
};
|
|
812
|
+
const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH = {
|
|
813
|
+
codecOptions: {
|
|
814
|
+
videoGoogleStartBitrate: 500,
|
|
815
|
+
},
|
|
816
|
+
encodings: [{ scalabilityMode: "L2T2_KEY", maxBitrate: 800000 }],
|
|
817
|
+
};
|
|
812
818
|
const SCREEN_SHARE_SETTINGS = {
|
|
813
819
|
encodings: [{}],
|
|
814
820
|
};
|
|
821
|
+
const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
|
|
822
|
+
encodings: [
|
|
823
|
+
{
|
|
824
|
+
maxBitrate: 600000,
|
|
825
|
+
maxFramerate: 2,
|
|
826
|
+
},
|
|
827
|
+
],
|
|
828
|
+
};
|
|
815
829
|
const SCREEN_SHARE_SIMULCAST_SETTINGS = {
|
|
816
830
|
encodings: [
|
|
817
831
|
{ scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
|
|
@@ -822,11 +836,13 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
|
|
|
822
836
|
encodings: [{ dtx: true }],
|
|
823
837
|
};
|
|
824
838
|
const getMediaSettings = (kind, isScreenShare, features) => {
|
|
825
|
-
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On } = features;
|
|
839
|
+
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, lowBandwidth } = features;
|
|
826
840
|
if (kind === "audio") {
|
|
827
841
|
return AUDIO_SETTINGS;
|
|
828
842
|
}
|
|
829
843
|
if (isScreenShare) {
|
|
844
|
+
if (lowBandwidth && !vp9On)
|
|
845
|
+
return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
|
|
830
846
|
if (vp9On)
|
|
831
847
|
return SCREEN_SHARE_SETTINGS_VP9;
|
|
832
848
|
if (simulcastScreenshareOn)
|
|
@@ -834,6 +850,11 @@ const getMediaSettings = (kind, isScreenShare, features) => {
|
|
|
834
850
|
return SCREEN_SHARE_SETTINGS;
|
|
835
851
|
}
|
|
836
852
|
else {
|
|
853
|
+
if (lowBandwidth) {
|
|
854
|
+
if (vp9On)
|
|
855
|
+
return VIDEO_SETTINGS_VP9_LOW_BANDWIDTH;
|
|
856
|
+
return VIDEO_SETTINGS_SD;
|
|
857
|
+
}
|
|
837
858
|
if (vp9On)
|
|
838
859
|
return VIDEO_SETTINGS_VP9;
|
|
839
860
|
if (lowDataModeEnabled)
|
|
@@ -4737,7 +4758,7 @@ class P2pRtcManager {
|
|
|
4737
4758
|
logger$3.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
4738
4759
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
4739
4760
|
if (!pendingActions) {
|
|
4740
|
-
logger$3.warn(`No pending action is created to
|
|
4761
|
+
logger$3.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
4741
4762
|
return;
|
|
4742
4763
|
}
|
|
4743
4764
|
const promise = new Promise((resolve, reject) => {
|
|
@@ -4961,9 +4982,9 @@ class P2pRtcManager {
|
|
|
4961
4982
|
let bandwidth = this._features.bandwidth
|
|
4962
4983
|
? parseInt(this._features.bandwidth, 10)
|
|
4963
4984
|
: {
|
|
4964
|
-
1: 0,
|
|
4965
|
-
2: this._features.highP2PBandwidth ? 768 : 384,
|
|
4966
|
-
3: this._features.highP2PBandwidth ? 512 : 256,
|
|
4985
|
+
1: this._features.lowBandwidth ? 768 : 0,
|
|
4986
|
+
2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
|
|
4987
|
+
3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
|
|
4967
4988
|
4: 192,
|
|
4968
4989
|
5: 128,
|
|
4969
4990
|
6: 128,
|
|
@@ -4985,7 +5006,7 @@ class P2pRtcManager {
|
|
|
4985
5006
|
}
|
|
4986
5007
|
}
|
|
4987
5008
|
}
|
|
4988
|
-
if (this._features.higherP2PBitrates) {
|
|
5009
|
+
if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
|
|
4989
5010
|
bandwidth = bandwidth * 1.5;
|
|
4990
5011
|
}
|
|
4991
5012
|
this._forEachPeerConnection((session) => {
|
|
@@ -6164,7 +6185,7 @@ class VegaRtcManager {
|
|
|
6164
6185
|
return;
|
|
6165
6186
|
}
|
|
6166
6187
|
this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6167
|
-
var _b;
|
|
6188
|
+
var _b, _c;
|
|
6168
6189
|
try {
|
|
6169
6190
|
const currentPaused = this._webcamPaused;
|
|
6170
6191
|
const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
|
|
@@ -6202,6 +6223,9 @@ class VegaRtcManager {
|
|
|
6202
6223
|
this._stopProducer(this._webcamProducer);
|
|
6203
6224
|
this._webcamProducer = null;
|
|
6204
6225
|
}
|
|
6226
|
+
if (this._features.lowBandwidth && this._screenVideoTrack) {
|
|
6227
|
+
(_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
|
|
6228
|
+
}
|
|
6205
6229
|
}
|
|
6206
6230
|
}))();
|
|
6207
6231
|
});
|
|
@@ -6260,6 +6284,7 @@ class VegaRtcManager {
|
|
|
6260
6284
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6261
6285
|
logger.info("_internalSendScreenVideo()");
|
|
6262
6286
|
this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6287
|
+
var _a, _b;
|
|
6263
6288
|
try {
|
|
6264
6289
|
if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
|
|
6265
6290
|
this._screenVideoProducerPromise = null;
|
|
@@ -6285,6 +6310,9 @@ class VegaRtcManager {
|
|
|
6285
6310
|
});
|
|
6286
6311
|
if (this._screenVideoTrack !== this._screenVideoProducer.track)
|
|
6287
6312
|
yield this._replaceScreenVideoTrack();
|
|
6313
|
+
if (this._features.lowBandwidth) {
|
|
6314
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
|
|
6315
|
+
}
|
|
6288
6316
|
}
|
|
6289
6317
|
catch (error) {
|
|
6290
6318
|
logger.error("screenVideoProducer failed:%o", error);
|
|
@@ -6294,6 +6322,9 @@ class VegaRtcManager {
|
|
|
6294
6322
|
if (!this._screenVideoTrack) {
|
|
6295
6323
|
yield this._stopProducer(this._screenVideoProducer);
|
|
6296
6324
|
this._screenVideoProducer = null;
|
|
6325
|
+
if (this._features.lowBandwidth) {
|
|
6326
|
+
(_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6327
|
+
}
|
|
6297
6328
|
}
|
|
6298
6329
|
}
|
|
6299
6330
|
}))();
|
|
@@ -6456,6 +6487,7 @@ class VegaRtcManager {
|
|
|
6456
6487
|
}
|
|
6457
6488
|
}
|
|
6458
6489
|
removeStream(streamId, _stream, requestedByClientId) {
|
|
6490
|
+
var _a;
|
|
6459
6491
|
logger.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
|
|
6460
6492
|
this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
|
|
6461
6493
|
streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
|
|
@@ -6467,6 +6499,9 @@ class VegaRtcManager {
|
|
|
6467
6499
|
this._stopProducer(this._screenAudioProducer);
|
|
6468
6500
|
this._screenAudioProducer = null;
|
|
6469
6501
|
this._screenAudioTrack = null;
|
|
6502
|
+
if (this._features.lowBandwidth) {
|
|
6503
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6504
|
+
}
|
|
6470
6505
|
}
|
|
6471
6506
|
_onMicAnalyserScoreUpdated(data) {
|
|
6472
6507
|
var _a, _b;
|
package/dist/index.d.cts
CHANGED
|
@@ -657,6 +657,7 @@ interface SignalClient {
|
|
|
657
657
|
isVideoEnabled: boolean;
|
|
658
658
|
role: ClientRole;
|
|
659
659
|
startedCloudRecordingAt: string | null;
|
|
660
|
+
breakoutGroup: string | null;
|
|
660
661
|
externalId: string | null;
|
|
661
662
|
isDialIn: boolean;
|
|
662
663
|
}
|
|
@@ -668,6 +669,10 @@ interface AudioEnabledEvent {
|
|
|
668
669
|
clientId: string;
|
|
669
670
|
isAudioEnabled: boolean;
|
|
670
671
|
}
|
|
672
|
+
interface BreakoutGroupJoinedEvent {
|
|
673
|
+
clientId: string;
|
|
674
|
+
group: string;
|
|
675
|
+
}
|
|
671
676
|
interface ChatMessage {
|
|
672
677
|
id: string;
|
|
673
678
|
messageType: "text";
|
|
@@ -725,6 +730,7 @@ interface RoomJoinedEvent {
|
|
|
725
730
|
} | null;
|
|
726
731
|
};
|
|
727
732
|
selfId: string;
|
|
733
|
+
breakoutGroup: string | null;
|
|
728
734
|
clientClaim?: string;
|
|
729
735
|
}
|
|
730
736
|
interface RoomKnockedEvent {
|
|
@@ -800,6 +806,7 @@ interface LiveTranscriptionStoppedEvent {
|
|
|
800
806
|
interface SignalEvents {
|
|
801
807
|
audio_enabled: AudioEnabledEvent;
|
|
802
808
|
audio_enable_requested: AudioEnableRequestedEvent;
|
|
809
|
+
breakout_group_joined: BreakoutGroupJoinedEvent;
|
|
803
810
|
client_left: ClientLeftEvent;
|
|
804
811
|
client_kicked: ClientKickedEvent;
|
|
805
812
|
client_metadata_received: ClientMetadataReceivedEvent;
|
|
@@ -1501,4 +1508,4 @@ declare class RtcStream {
|
|
|
1501
1508
|
static getTypeFromId(id: string): string;
|
|
1502
1509
|
}
|
|
1503
1510
|
|
|
1504
|
-
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
|
1511
|
+
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutGroupJoinedEvent, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
package/dist/index.d.mts
CHANGED
|
@@ -657,6 +657,7 @@ interface SignalClient {
|
|
|
657
657
|
isVideoEnabled: boolean;
|
|
658
658
|
role: ClientRole;
|
|
659
659
|
startedCloudRecordingAt: string | null;
|
|
660
|
+
breakoutGroup: string | null;
|
|
660
661
|
externalId: string | null;
|
|
661
662
|
isDialIn: boolean;
|
|
662
663
|
}
|
|
@@ -668,6 +669,10 @@ interface AudioEnabledEvent {
|
|
|
668
669
|
clientId: string;
|
|
669
670
|
isAudioEnabled: boolean;
|
|
670
671
|
}
|
|
672
|
+
interface BreakoutGroupJoinedEvent {
|
|
673
|
+
clientId: string;
|
|
674
|
+
group: string;
|
|
675
|
+
}
|
|
671
676
|
interface ChatMessage {
|
|
672
677
|
id: string;
|
|
673
678
|
messageType: "text";
|
|
@@ -725,6 +730,7 @@ interface RoomJoinedEvent {
|
|
|
725
730
|
} | null;
|
|
726
731
|
};
|
|
727
732
|
selfId: string;
|
|
733
|
+
breakoutGroup: string | null;
|
|
728
734
|
clientClaim?: string;
|
|
729
735
|
}
|
|
730
736
|
interface RoomKnockedEvent {
|
|
@@ -800,6 +806,7 @@ interface LiveTranscriptionStoppedEvent {
|
|
|
800
806
|
interface SignalEvents {
|
|
801
807
|
audio_enabled: AudioEnabledEvent;
|
|
802
808
|
audio_enable_requested: AudioEnableRequestedEvent;
|
|
809
|
+
breakout_group_joined: BreakoutGroupJoinedEvent;
|
|
803
810
|
client_left: ClientLeftEvent;
|
|
804
811
|
client_kicked: ClientKickedEvent;
|
|
805
812
|
client_metadata_received: ClientMetadataReceivedEvent;
|
|
@@ -1501,4 +1508,4 @@ declare class RtcStream {
|
|
|
1501
1508
|
static getTypeFromId(id: string): string;
|
|
1502
1509
|
}
|
|
1503
1510
|
|
|
1504
|
-
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
|
1511
|
+
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutGroupJoinedEvent, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
package/dist/index.d.ts
CHANGED
|
@@ -657,6 +657,7 @@ interface SignalClient {
|
|
|
657
657
|
isVideoEnabled: boolean;
|
|
658
658
|
role: ClientRole;
|
|
659
659
|
startedCloudRecordingAt: string | null;
|
|
660
|
+
breakoutGroup: string | null;
|
|
660
661
|
externalId: string | null;
|
|
661
662
|
isDialIn: boolean;
|
|
662
663
|
}
|
|
@@ -668,6 +669,10 @@ interface AudioEnabledEvent {
|
|
|
668
669
|
clientId: string;
|
|
669
670
|
isAudioEnabled: boolean;
|
|
670
671
|
}
|
|
672
|
+
interface BreakoutGroupJoinedEvent {
|
|
673
|
+
clientId: string;
|
|
674
|
+
group: string;
|
|
675
|
+
}
|
|
671
676
|
interface ChatMessage {
|
|
672
677
|
id: string;
|
|
673
678
|
messageType: "text";
|
|
@@ -725,6 +730,7 @@ interface RoomJoinedEvent {
|
|
|
725
730
|
} | null;
|
|
726
731
|
};
|
|
727
732
|
selfId: string;
|
|
733
|
+
breakoutGroup: string | null;
|
|
728
734
|
clientClaim?: string;
|
|
729
735
|
}
|
|
730
736
|
interface RoomKnockedEvent {
|
|
@@ -800,6 +806,7 @@ interface LiveTranscriptionStoppedEvent {
|
|
|
800
806
|
interface SignalEvents {
|
|
801
807
|
audio_enabled: AudioEnabledEvent;
|
|
802
808
|
audio_enable_requested: AudioEnableRequestedEvent;
|
|
809
|
+
breakout_group_joined: BreakoutGroupJoinedEvent;
|
|
803
810
|
client_left: ClientLeftEvent;
|
|
804
811
|
client_kicked: ClientKickedEvent;
|
|
805
812
|
client_metadata_received: ClientMetadataReceivedEvent;
|
|
@@ -1501,4 +1508,4 @@ declare class RtcStream {
|
|
|
1501
1508
|
static getTypeFromId(id: string): string;
|
|
1502
1509
|
}
|
|
1503
1510
|
|
|
1504
|
-
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
|
1511
|
+
export { type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutGroupJoinedEvent, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Credentials, type CustomMediaStreamTrack, EVENTS, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type IdentifyDeviceRequest, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type NewClientEvent, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomJoinedEvent, type RoomKnockedEvent, type RoomLockedEvent, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, TYPES, type TurnTransportProtocol, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getHandler, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getStream2, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, variance };
|
package/dist/index.mjs
CHANGED
|
@@ -788,9 +788,23 @@ const VIDEO_SETTINGS_VP9 = {
|
|
|
788
788
|
},
|
|
789
789
|
encodings: [{ scalabilityMode: "L3T2_KEY" }],
|
|
790
790
|
};
|
|
791
|
+
const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH = {
|
|
792
|
+
codecOptions: {
|
|
793
|
+
videoGoogleStartBitrate: 500,
|
|
794
|
+
},
|
|
795
|
+
encodings: [{ scalabilityMode: "L2T2_KEY", maxBitrate: 800000 }],
|
|
796
|
+
};
|
|
791
797
|
const SCREEN_SHARE_SETTINGS = {
|
|
792
798
|
encodings: [{}],
|
|
793
799
|
};
|
|
800
|
+
const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
|
|
801
|
+
encodings: [
|
|
802
|
+
{
|
|
803
|
+
maxBitrate: 600000,
|
|
804
|
+
maxFramerate: 2,
|
|
805
|
+
},
|
|
806
|
+
],
|
|
807
|
+
};
|
|
794
808
|
const SCREEN_SHARE_SIMULCAST_SETTINGS = {
|
|
795
809
|
encodings: [
|
|
796
810
|
{ scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
|
|
@@ -801,11 +815,13 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
|
|
|
801
815
|
encodings: [{ dtx: true }],
|
|
802
816
|
};
|
|
803
817
|
const getMediaSettings = (kind, isScreenShare, features) => {
|
|
804
|
-
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On } = features;
|
|
818
|
+
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, lowBandwidth } = features;
|
|
805
819
|
if (kind === "audio") {
|
|
806
820
|
return AUDIO_SETTINGS;
|
|
807
821
|
}
|
|
808
822
|
if (isScreenShare) {
|
|
823
|
+
if (lowBandwidth && !vp9On)
|
|
824
|
+
return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
|
|
809
825
|
if (vp9On)
|
|
810
826
|
return SCREEN_SHARE_SETTINGS_VP9;
|
|
811
827
|
if (simulcastScreenshareOn)
|
|
@@ -813,6 +829,11 @@ const getMediaSettings = (kind, isScreenShare, features) => {
|
|
|
813
829
|
return SCREEN_SHARE_SETTINGS;
|
|
814
830
|
}
|
|
815
831
|
else {
|
|
832
|
+
if (lowBandwidth) {
|
|
833
|
+
if (vp9On)
|
|
834
|
+
return VIDEO_SETTINGS_VP9_LOW_BANDWIDTH;
|
|
835
|
+
return VIDEO_SETTINGS_SD;
|
|
836
|
+
}
|
|
816
837
|
if (vp9On)
|
|
817
838
|
return VIDEO_SETTINGS_VP9;
|
|
818
839
|
if (lowDataModeEnabled)
|
|
@@ -4716,7 +4737,7 @@ class P2pRtcManager {
|
|
|
4716
4737
|
logger$3.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
4717
4738
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
4718
4739
|
if (!pendingActions) {
|
|
4719
|
-
logger$3.warn(`No pending action is created to
|
|
4740
|
+
logger$3.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
4720
4741
|
return;
|
|
4721
4742
|
}
|
|
4722
4743
|
const promise = new Promise((resolve, reject) => {
|
|
@@ -4940,9 +4961,9 @@ class P2pRtcManager {
|
|
|
4940
4961
|
let bandwidth = this._features.bandwidth
|
|
4941
4962
|
? parseInt(this._features.bandwidth, 10)
|
|
4942
4963
|
: {
|
|
4943
|
-
1: 0,
|
|
4944
|
-
2: this._features.highP2PBandwidth ? 768 : 384,
|
|
4945
|
-
3: this._features.highP2PBandwidth ? 512 : 256,
|
|
4964
|
+
1: this._features.lowBandwidth ? 768 : 0,
|
|
4965
|
+
2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
|
|
4966
|
+
3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
|
|
4946
4967
|
4: 192,
|
|
4947
4968
|
5: 128,
|
|
4948
4969
|
6: 128,
|
|
@@ -4964,7 +4985,7 @@ class P2pRtcManager {
|
|
|
4964
4985
|
}
|
|
4965
4986
|
}
|
|
4966
4987
|
}
|
|
4967
|
-
if (this._features.higherP2PBitrates) {
|
|
4988
|
+
if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
|
|
4968
4989
|
bandwidth = bandwidth * 1.5;
|
|
4969
4990
|
}
|
|
4970
4991
|
this._forEachPeerConnection((session) => {
|
|
@@ -6143,7 +6164,7 @@ class VegaRtcManager {
|
|
|
6143
6164
|
return;
|
|
6144
6165
|
}
|
|
6145
6166
|
this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6146
|
-
var _b;
|
|
6167
|
+
var _b, _c;
|
|
6147
6168
|
try {
|
|
6148
6169
|
const currentPaused = this._webcamPaused;
|
|
6149
6170
|
const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
|
|
@@ -6181,6 +6202,9 @@ class VegaRtcManager {
|
|
|
6181
6202
|
this._stopProducer(this._webcamProducer);
|
|
6182
6203
|
this._webcamProducer = null;
|
|
6183
6204
|
}
|
|
6205
|
+
if (this._features.lowBandwidth && this._screenVideoTrack) {
|
|
6206
|
+
(_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
|
|
6207
|
+
}
|
|
6184
6208
|
}
|
|
6185
6209
|
}))();
|
|
6186
6210
|
});
|
|
@@ -6239,6 +6263,7 @@ class VegaRtcManager {
|
|
|
6239
6263
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6240
6264
|
logger.info("_internalSendScreenVideo()");
|
|
6241
6265
|
this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6266
|
+
var _a, _b;
|
|
6242
6267
|
try {
|
|
6243
6268
|
if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
|
|
6244
6269
|
this._screenVideoProducerPromise = null;
|
|
@@ -6264,6 +6289,9 @@ class VegaRtcManager {
|
|
|
6264
6289
|
});
|
|
6265
6290
|
if (this._screenVideoTrack !== this._screenVideoProducer.track)
|
|
6266
6291
|
yield this._replaceScreenVideoTrack();
|
|
6292
|
+
if (this._features.lowBandwidth) {
|
|
6293
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
|
|
6294
|
+
}
|
|
6267
6295
|
}
|
|
6268
6296
|
catch (error) {
|
|
6269
6297
|
logger.error("screenVideoProducer failed:%o", error);
|
|
@@ -6273,6 +6301,9 @@ class VegaRtcManager {
|
|
|
6273
6301
|
if (!this._screenVideoTrack) {
|
|
6274
6302
|
yield this._stopProducer(this._screenVideoProducer);
|
|
6275
6303
|
this._screenVideoProducer = null;
|
|
6304
|
+
if (this._features.lowBandwidth) {
|
|
6305
|
+
(_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6306
|
+
}
|
|
6276
6307
|
}
|
|
6277
6308
|
}
|
|
6278
6309
|
}))();
|
|
@@ -6435,6 +6466,7 @@ class VegaRtcManager {
|
|
|
6435
6466
|
}
|
|
6436
6467
|
}
|
|
6437
6468
|
removeStream(streamId, _stream, requestedByClientId) {
|
|
6469
|
+
var _a;
|
|
6438
6470
|
logger.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
|
|
6439
6471
|
this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
|
|
6440
6472
|
streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
|
|
@@ -6446,6 +6478,9 @@ class VegaRtcManager {
|
|
|
6446
6478
|
this._stopProducer(this._screenAudioProducer);
|
|
6447
6479
|
this._screenAudioProducer = null;
|
|
6448
6480
|
this._screenAudioTrack = null;
|
|
6481
|
+
if (this._features.lowBandwidth) {
|
|
6482
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6483
|
+
}
|
|
6449
6484
|
}
|
|
6450
6485
|
_onMicAnalyserScoreUpdated(data) {
|
|
6451
6486
|
var _a, _b;
|
package/dist/legacy-esm.js
CHANGED
|
@@ -788,9 +788,23 @@ const VIDEO_SETTINGS_VP9 = {
|
|
|
788
788
|
},
|
|
789
789
|
encodings: [{ scalabilityMode: "L3T2_KEY" }],
|
|
790
790
|
};
|
|
791
|
+
const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH = {
|
|
792
|
+
codecOptions: {
|
|
793
|
+
videoGoogleStartBitrate: 500,
|
|
794
|
+
},
|
|
795
|
+
encodings: [{ scalabilityMode: "L2T2_KEY", maxBitrate: 800000 }],
|
|
796
|
+
};
|
|
791
797
|
const SCREEN_SHARE_SETTINGS = {
|
|
792
798
|
encodings: [{}],
|
|
793
799
|
};
|
|
800
|
+
const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
|
|
801
|
+
encodings: [
|
|
802
|
+
{
|
|
803
|
+
maxBitrate: 600000,
|
|
804
|
+
maxFramerate: 2,
|
|
805
|
+
},
|
|
806
|
+
],
|
|
807
|
+
};
|
|
794
808
|
const SCREEN_SHARE_SIMULCAST_SETTINGS = {
|
|
795
809
|
encodings: [
|
|
796
810
|
{ scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
|
|
@@ -801,11 +815,13 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
|
|
|
801
815
|
encodings: [{ dtx: true }],
|
|
802
816
|
};
|
|
803
817
|
const getMediaSettings = (kind, isScreenShare, features) => {
|
|
804
|
-
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On } = features;
|
|
818
|
+
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, lowBandwidth } = features;
|
|
805
819
|
if (kind === "audio") {
|
|
806
820
|
return AUDIO_SETTINGS;
|
|
807
821
|
}
|
|
808
822
|
if (isScreenShare) {
|
|
823
|
+
if (lowBandwidth && !vp9On)
|
|
824
|
+
return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
|
|
809
825
|
if (vp9On)
|
|
810
826
|
return SCREEN_SHARE_SETTINGS_VP9;
|
|
811
827
|
if (simulcastScreenshareOn)
|
|
@@ -813,6 +829,11 @@ const getMediaSettings = (kind, isScreenShare, features) => {
|
|
|
813
829
|
return SCREEN_SHARE_SETTINGS;
|
|
814
830
|
}
|
|
815
831
|
else {
|
|
832
|
+
if (lowBandwidth) {
|
|
833
|
+
if (vp9On)
|
|
834
|
+
return VIDEO_SETTINGS_VP9_LOW_BANDWIDTH;
|
|
835
|
+
return VIDEO_SETTINGS_SD;
|
|
836
|
+
}
|
|
816
837
|
if (vp9On)
|
|
817
838
|
return VIDEO_SETTINGS_VP9;
|
|
818
839
|
if (lowDataModeEnabled)
|
|
@@ -4716,7 +4737,7 @@ class P2pRtcManager {
|
|
|
4716
4737
|
logger$3.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
4717
4738
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
4718
4739
|
if (!pendingActions) {
|
|
4719
|
-
logger$3.warn(`No pending action is created to
|
|
4740
|
+
logger$3.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
4720
4741
|
return;
|
|
4721
4742
|
}
|
|
4722
4743
|
const promise = new Promise((resolve, reject) => {
|
|
@@ -4940,9 +4961,9 @@ class P2pRtcManager {
|
|
|
4940
4961
|
let bandwidth = this._features.bandwidth
|
|
4941
4962
|
? parseInt(this._features.bandwidth, 10)
|
|
4942
4963
|
: {
|
|
4943
|
-
1: 0,
|
|
4944
|
-
2: this._features.highP2PBandwidth ? 768 : 384,
|
|
4945
|
-
3: this._features.highP2PBandwidth ? 512 : 256,
|
|
4964
|
+
1: this._features.lowBandwidth ? 768 : 0,
|
|
4965
|
+
2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
|
|
4966
|
+
3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
|
|
4946
4967
|
4: 192,
|
|
4947
4968
|
5: 128,
|
|
4948
4969
|
6: 128,
|
|
@@ -4964,7 +4985,7 @@ class P2pRtcManager {
|
|
|
4964
4985
|
}
|
|
4965
4986
|
}
|
|
4966
4987
|
}
|
|
4967
|
-
if (this._features.higherP2PBitrates) {
|
|
4988
|
+
if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
|
|
4968
4989
|
bandwidth = bandwidth * 1.5;
|
|
4969
4990
|
}
|
|
4970
4991
|
this._forEachPeerConnection((session) => {
|
|
@@ -6143,7 +6164,7 @@ class VegaRtcManager {
|
|
|
6143
6164
|
return;
|
|
6144
6165
|
}
|
|
6145
6166
|
this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6146
|
-
var _b;
|
|
6167
|
+
var _b, _c;
|
|
6147
6168
|
try {
|
|
6148
6169
|
const currentPaused = this._webcamPaused;
|
|
6149
6170
|
const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, this._features)), { appData: {
|
|
@@ -6181,6 +6202,9 @@ class VegaRtcManager {
|
|
|
6181
6202
|
this._stopProducer(this._webcamProducer);
|
|
6182
6203
|
this._webcamProducer = null;
|
|
6183
6204
|
}
|
|
6205
|
+
if (this._features.lowBandwidth && this._screenVideoTrack) {
|
|
6206
|
+
(_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
|
|
6207
|
+
}
|
|
6184
6208
|
}
|
|
6185
6209
|
}))();
|
|
6186
6210
|
});
|
|
@@ -6239,6 +6263,7 @@ class VegaRtcManager {
|
|
|
6239
6263
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6240
6264
|
logger.info("_internalSendScreenVideo()");
|
|
6241
6265
|
this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
6266
|
+
var _a, _b;
|
|
6242
6267
|
try {
|
|
6243
6268
|
if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
|
|
6244
6269
|
this._screenVideoProducerPromise = null;
|
|
@@ -6264,6 +6289,9 @@ class VegaRtcManager {
|
|
|
6264
6289
|
});
|
|
6265
6290
|
if (this._screenVideoTrack !== this._screenVideoProducer.track)
|
|
6266
6291
|
yield this._replaceScreenVideoTrack();
|
|
6292
|
+
if (this._features.lowBandwidth) {
|
|
6293
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
|
|
6294
|
+
}
|
|
6267
6295
|
}
|
|
6268
6296
|
catch (error) {
|
|
6269
6297
|
logger.error("screenVideoProducer failed:%o", error);
|
|
@@ -6273,6 +6301,9 @@ class VegaRtcManager {
|
|
|
6273
6301
|
if (!this._screenVideoTrack) {
|
|
6274
6302
|
yield this._stopProducer(this._screenVideoProducer);
|
|
6275
6303
|
this._screenVideoProducer = null;
|
|
6304
|
+
if (this._features.lowBandwidth) {
|
|
6305
|
+
(_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6306
|
+
}
|
|
6276
6307
|
}
|
|
6277
6308
|
}
|
|
6278
6309
|
}))();
|
|
@@ -6435,6 +6466,7 @@ class VegaRtcManager {
|
|
|
6435
6466
|
}
|
|
6436
6467
|
}
|
|
6437
6468
|
removeStream(streamId, _stream, requestedByClientId) {
|
|
6469
|
+
var _a;
|
|
6438
6470
|
logger.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
|
|
6439
6471
|
this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
|
|
6440
6472
|
streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
|
|
@@ -6446,6 +6478,9 @@ class VegaRtcManager {
|
|
|
6446
6478
|
this._stopProducer(this._screenAudioProducer);
|
|
6447
6479
|
this._screenAudioProducer = null;
|
|
6448
6480
|
this._screenAudioTrack = null;
|
|
6481
|
+
if (this._features.lowBandwidth) {
|
|
6482
|
+
(_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
|
|
6483
|
+
}
|
|
6449
6484
|
}
|
|
6450
6485
|
_onMicAnalyserScoreUpdated(data) {
|
|
6451
6486
|
var _a, _b;
|