@whereby.com/media 1.30.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -109
- package/dist/index.d.cts +3 -32
- package/dist/index.d.mts +3 -32
- package/dist/index.d.ts +3 -32
- package/dist/index.mjs +33 -105
- package/dist/legacy-esm.js +33 -105
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -870,7 +870,7 @@ const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6
|
|
|
870
870
|
const logger$b = new Logger();
|
|
871
871
|
const browserName$2 = adapter$6.browserDetails.browser;
|
|
872
872
|
const browserVersion$1 = adapter$6.browserDetails.version;
|
|
873
|
-
function setCodecPreferenceSDP(sdp,
|
|
873
|
+
function setCodecPreferenceSDP(sdp, redOn) {
|
|
874
874
|
var _a, _b;
|
|
875
875
|
try {
|
|
876
876
|
const sdpObject = sdpTransform__namespace.parse(sdp);
|
|
@@ -893,7 +893,7 @@ function setCodecPreferenceSDP(sdp, vp9On, redOn) {
|
|
|
893
893
|
if (Array.isArray(mediaVideo === null || mediaVideo === void 0 ? void 0 : mediaVideo.rtp)) {
|
|
894
894
|
const rtp = mediaVideo.rtp;
|
|
895
895
|
for (let i = 0; i < rtp.length; i++) {
|
|
896
|
-
if (
|
|
896
|
+
if (rtp[i].codec === "VP9") {
|
|
897
897
|
const payloads = (_b = mediaVideo.payloads) === null || _b === void 0 ? void 0 : _b.split(" ");
|
|
898
898
|
const pt = payloads === null || payloads === void 0 ? void 0 : payloads.indexOf("" + rtp[i].payload);
|
|
899
899
|
if (pt && pt !== -1 && pt >= 0) {
|
|
@@ -914,18 +914,25 @@ function setCodecPreferenceSDP(sdp, vp9On, redOn) {
|
|
|
914
914
|
function cleanSdp(sdp) {
|
|
915
915
|
try {
|
|
916
916
|
const sdpObject = sdpTransform__namespace.parse(sdp);
|
|
917
|
-
sdpObject.media.forEach(mediaObject => {
|
|
917
|
+
sdpObject.media.forEach((mediaObject) => {
|
|
918
918
|
const usedPayloads = {};
|
|
919
919
|
if (mediaObject.payloads)
|
|
920
|
-
mediaObject.payloads = ("" + mediaObject.payloads)
|
|
920
|
+
mediaObject.payloads = ("" + mediaObject.payloads)
|
|
921
|
+
.split(" ")
|
|
922
|
+
.filter((p) => !usedPayloads[p] && (usedPayloads[p] = true))
|
|
923
|
+
.join(" ");
|
|
921
924
|
const usedRtps = {};
|
|
922
|
-
mediaObject.rtp = mediaObject.rtp.filter(p => !p.payload || (usedPayloads[p.payload] && !usedRtps[p.payload] && (usedRtps[p.payload] = true)));
|
|
925
|
+
mediaObject.rtp = mediaObject.rtp.filter((p) => !p.payload || (usedPayloads[p.payload] && !usedRtps[p.payload] && (usedRtps[p.payload] = true)));
|
|
923
926
|
const usedFmtps = {};
|
|
924
927
|
if (mediaObject.fmtp)
|
|
925
|
-
mediaObject.fmtp = mediaObject.fmtp.filter(p => !p.payload ||
|
|
928
|
+
mediaObject.fmtp = mediaObject.fmtp.filter((p) => !p.payload ||
|
|
929
|
+
(usedPayloads[p.payload] && !usedFmtps[p.payload] && (usedFmtps[p.payload] = true)));
|
|
926
930
|
const usedRtcpFb = {};
|
|
927
931
|
if (mediaObject.rtcpFb)
|
|
928
|
-
mediaObject.rtcpFb = mediaObject.rtcpFb.filter(p => !p.payload ||
|
|
932
|
+
mediaObject.rtcpFb = mediaObject.rtcpFb.filter((p) => !p.payload ||
|
|
933
|
+
(usedPayloads[p.payload] &&
|
|
934
|
+
!usedRtcpFb[p.payload + p.type + p.subtype] &&
|
|
935
|
+
(usedRtcpFb[p.payload + p.type + p.subtype] = true)));
|
|
929
936
|
});
|
|
930
937
|
return sdpTransform__namespace.write(sdpObject);
|
|
931
938
|
}
|
|
@@ -1062,32 +1069,6 @@ function addAbsCaptureTimeExtMap(sdp) {
|
|
|
1062
1069
|
return addExtMap(sdp, absCaptureTimeUri, true, true);
|
|
1063
1070
|
}
|
|
1064
1071
|
|
|
1065
|
-
function isRelayed(pc) {
|
|
1066
|
-
return pc.getStats(null).then((result) => {
|
|
1067
|
-
let localCandidateType;
|
|
1068
|
-
let remoteCandidateType;
|
|
1069
|
-
result.forEach((report) => {
|
|
1070
|
-
if (report.type === "transport" && report.selectedCandidatePairId) {
|
|
1071
|
-
const transport = result.get(report.selectedCandidatePairId);
|
|
1072
|
-
if (!transport) {
|
|
1073
|
-
return;
|
|
1074
|
-
}
|
|
1075
|
-
localCandidateType = result.get(transport.localCandidateId).candidateType;
|
|
1076
|
-
remoteCandidateType = result.get(transport.remoteCandidateId).candidateType;
|
|
1077
|
-
return;
|
|
1078
|
-
}
|
|
1079
|
-
if (report.type === "candidate-pair" && report.selected) {
|
|
1080
|
-
localCandidateType = result.get(report.localCandidateId).candidateType;
|
|
1081
|
-
remoteCandidateType = result.get(report.remoteCandidateId).candidateType;
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
return (localCandidateType === "relay" ||
|
|
1085
|
-
localCandidateType === "relayed" ||
|
|
1086
|
-
remoteCandidateType === "relay" ||
|
|
1087
|
-
remoteCandidateType === "relayed");
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
1072
|
function setVideoBandwidthUsingSetParameters(pc, bandwidth, logger = console) {
|
|
1092
1073
|
const sender = pc.getSenders().find((s) => s.track && s.track.kind === "video");
|
|
1093
1074
|
if (!sender) {
|
|
@@ -1111,15 +1092,11 @@ function setVideoBandwidthUsingSetParameters(pc, bandwidth, logger = console) {
|
|
|
1111
1092
|
});
|
|
1112
1093
|
}
|
|
1113
1094
|
|
|
1114
|
-
const MAXIMUM_TURN_BANDWIDTH = 1280;
|
|
1115
|
-
const MAXIMUM_TURN_BANDWIDTH_UNLIMITED = -1;
|
|
1116
|
-
const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
1117
|
-
|
|
1118
1095
|
var _a$5;
|
|
1119
1096
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
1120
1097
|
const logger$a = new Logger();
|
|
1121
1098
|
class Session {
|
|
1122
|
-
constructor({ peerConnectionId, bandwidth,
|
|
1099
|
+
constructor({ peerConnectionId, bandwidth, deprioritizeH264Encoding, }) {
|
|
1123
1100
|
this.peerConnectionId = peerConnectionId;
|
|
1124
1101
|
this.relayCandidateSeen = false;
|
|
1125
1102
|
this.serverReflexiveCandidateSeen = false;
|
|
@@ -1136,7 +1113,6 @@ class Session {
|
|
|
1136
1113
|
totalRecv: 0,
|
|
1137
1114
|
};
|
|
1138
1115
|
this.bandwidth = bandwidth || 0;
|
|
1139
|
-
this.maximumTurnBandwidth = maximumTurnBandwidth;
|
|
1140
1116
|
this.pending = [];
|
|
1141
1117
|
this.isOperationPending = false;
|
|
1142
1118
|
this.streamIds = [];
|
|
@@ -1396,19 +1372,6 @@ class Session {
|
|
|
1396
1372
|
});
|
|
1397
1373
|
}
|
|
1398
1374
|
}
|
|
1399
|
-
maybeRestrictRelayBandwidth() {
|
|
1400
|
-
if (this.maximumTurnBandwidth === MAXIMUM_TURN_BANDWIDTH_UNLIMITED) {
|
|
1401
|
-
return;
|
|
1402
|
-
}
|
|
1403
|
-
if (!this.pc.getStats) {
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
isRelayed(this.pc).then((isRelayed) => {
|
|
1407
|
-
if (isRelayed && this.bandwidth === 0) {
|
|
1408
|
-
this.changeBandwidth(this.maximumTurnBandwidth);
|
|
1409
|
-
}
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
1375
|
changeBandwidth(bandwidth) {
|
|
1413
1376
|
if (bandwidth === this.bandwidth) {
|
|
1414
1377
|
return;
|
|
@@ -1439,6 +1402,8 @@ class Session {
|
|
|
1439
1402
|
}
|
|
1440
1403
|
}
|
|
1441
1404
|
|
|
1405
|
+
const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
1406
|
+
|
|
1442
1407
|
var _a$4;
|
|
1443
1408
|
const adapter$4 = (_a$4 = adapterRaw.default) !== null && _a$4 !== void 0 ? _a$4 : adapterRaw;
|
|
1444
1409
|
function detectMicrophoneNotWorking(pc) {
|
|
@@ -2530,24 +2495,12 @@ const VIDEO_SETTINGS_VP9 = {
|
|
|
2530
2495
|
},
|
|
2531
2496
|
encodings: [{ scalabilityMode: "L3T2", maxBitrate: 1000000 }],
|
|
2532
2497
|
};
|
|
2533
|
-
const VIDEO_SETTINGS_VP9_KEY = {
|
|
2534
|
-
codecOptions: {
|
|
2535
|
-
videoGoogleStartBitrate: 500,
|
|
2536
|
-
},
|
|
2537
|
-
encodings: [{ scalabilityMode: "L3T2_KEY", maxBitrate: 1250000 }],
|
|
2538
|
-
};
|
|
2539
2498
|
const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH = {
|
|
2540
2499
|
codecOptions: {
|
|
2541
2500
|
videoGoogleStartBitrate: 500,
|
|
2542
2501
|
},
|
|
2543
2502
|
encodings: [{ scalabilityMode: "L2T2", maxBitrate: 500000 }],
|
|
2544
2503
|
};
|
|
2545
|
-
const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY = {
|
|
2546
|
-
codecOptions: {
|
|
2547
|
-
videoGoogleStartBitrate: 500,
|
|
2548
|
-
},
|
|
2549
|
-
encodings: [{ scalabilityMode: "L2T2_KEY", maxBitrate: 650000 }],
|
|
2550
|
-
};
|
|
2551
2504
|
const SCREEN_SHARE_SETTINGS = {
|
|
2552
2505
|
encodings: [{}],
|
|
2553
2506
|
};
|
|
@@ -2565,13 +2518,13 @@ const ADDITIONAL_SCREEN_SHARE_SETTINGS = {
|
|
|
2565
2518
|
],
|
|
2566
2519
|
};
|
|
2567
2520
|
const ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9 = {
|
|
2568
|
-
encodings: [{ scalabilityMode: "
|
|
2521
|
+
encodings: [{ scalabilityMode: "L2T2", dtx: true, maxBitrate: 1500000 }],
|
|
2569
2522
|
};
|
|
2570
2523
|
const SCREEN_SHARE_SETTINGS_VP9 = {
|
|
2571
2524
|
encodings: [{ dtx: true }],
|
|
2572
2525
|
};
|
|
2573
2526
|
const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresenting = false) => {
|
|
2574
|
-
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On
|
|
2527
|
+
const { lowDataModeEnabled, simulcastScreenshareOn, vp9On } = features;
|
|
2575
2528
|
if (kind === "audio") {
|
|
2576
2529
|
return AUDIO_SETTINGS;
|
|
2577
2530
|
}
|
|
@@ -2588,22 +2541,17 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
|
|
|
2588
2541
|
return getCameraMediaSettings({
|
|
2589
2542
|
lowBandwidth: lowDataModeEnabled,
|
|
2590
2543
|
isVp9Available,
|
|
2591
|
-
svcKeyScalabilityModeOn,
|
|
2592
2544
|
});
|
|
2593
2545
|
}
|
|
2594
2546
|
};
|
|
2595
|
-
const getCameraMediaSettings = ({ lowBandwidth, isVp9Available,
|
|
2547
|
+
const getCameraMediaSettings = ({ lowBandwidth, isVp9Available, }) => {
|
|
2596
2548
|
if (lowBandwidth) {
|
|
2597
2549
|
if (isVp9Available) {
|
|
2598
|
-
if (svcKeyScalabilityModeOn)
|
|
2599
|
-
return VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY;
|
|
2600
2550
|
return VIDEO_SETTINGS_VP9_LOW_BANDWIDTH;
|
|
2601
2551
|
}
|
|
2602
2552
|
return VIDEO_SETTINGS_SD;
|
|
2603
2553
|
}
|
|
2604
2554
|
if (isVp9Available) {
|
|
2605
|
-
if (svcKeyScalabilityModeOn)
|
|
2606
|
-
return VIDEO_SETTINGS_VP9_KEY;
|
|
2607
2555
|
return VIDEO_SETTINGS_VP9;
|
|
2608
2556
|
}
|
|
2609
2557
|
return VIDEO_SETTINGS_HD;
|
|
@@ -2660,10 +2608,8 @@ function prioritizeRouterRtpCapabilitiesCodecs(codecs, preferredCodec) {
|
|
|
2660
2608
|
return 0;
|
|
2661
2609
|
});
|
|
2662
2610
|
}
|
|
2663
|
-
function getPreferredOrder(availableCodecs, {
|
|
2664
|
-
|
|
2665
|
-
availableCodecs.unshift("video/vp9");
|
|
2666
|
-
}
|
|
2611
|
+
function getPreferredOrder(availableCodecs, { av1On }) {
|
|
2612
|
+
availableCodecs.unshift("video/vp9");
|
|
2667
2613
|
if (av1On) {
|
|
2668
2614
|
availableCodecs.unshift("video/av1");
|
|
2669
2615
|
}
|
|
@@ -2711,11 +2657,9 @@ function sortCodecsByPowerEfficiency(codecs) {
|
|
|
2711
2657
|
}
|
|
2712
2658
|
function sortCodecs(codecs, features) {
|
|
2713
2659
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
}
|
|
2718
|
-
return codecs;
|
|
2660
|
+
let sortedCodecs = sortCodecsByMimeType(codecs, features);
|
|
2661
|
+
sortedCodecs = yield sortCodecsByPowerEfficiency(codecs);
|
|
2662
|
+
return sortedCodecs;
|
|
2719
2663
|
});
|
|
2720
2664
|
}
|
|
2721
2665
|
|
|
@@ -3257,9 +3201,6 @@ class P2pRtcManager {
|
|
|
3257
3201
|
supportsScreenShareAudio() {
|
|
3258
3202
|
return true;
|
|
3259
3203
|
}
|
|
3260
|
-
maybeRestrictRelayBandwidth(session) {
|
|
3261
|
-
session.maybeRestrictRelayBandwidth();
|
|
3262
|
-
}
|
|
3263
3204
|
addNewStream(streamId, stream, audioPaused, videoPaused, beforeEffectTracks = []) {
|
|
3264
3205
|
if (stream === this.localStreams[streamId]) {
|
|
3265
3206
|
return;
|
|
@@ -3530,9 +3471,6 @@ class P2pRtcManager {
|
|
|
3530
3471
|
this.peerConnections[peerConnectionId] = session = new Session({
|
|
3531
3472
|
peerConnectionId,
|
|
3532
3473
|
bandwidth: initialBandwidth,
|
|
3533
|
-
maximumTurnBandwidth: this._features.unlimitedBandwidthWhenUsingRelayP2POn
|
|
3534
|
-
? MAXIMUM_TURN_BANDWIDTH_UNLIMITED
|
|
3535
|
-
: MAXIMUM_TURN_BANDWIDTH,
|
|
3536
3474
|
deprioritizeH264Encoding,
|
|
3537
3475
|
});
|
|
3538
3476
|
this.totalSessionsCreated++;
|
|
@@ -3637,9 +3575,6 @@ class P2pRtcManager {
|
|
|
3637
3575
|
(pc.iceConnectionState.match(/connected|completed/) ||
|
|
3638
3576
|
(browserName$1 === "chrome" && pc.localDescription && pc.localDescription.type === "answer"))) {
|
|
3639
3577
|
session.wasEverConnected = true;
|
|
3640
|
-
if (this._features.bandwidth !== "false") {
|
|
3641
|
-
this.maybeRestrictRelayBandwidth(session);
|
|
3642
|
-
}
|
|
3643
3578
|
}
|
|
3644
3579
|
if (this._isAudioOnlyMode) {
|
|
3645
3580
|
session.setAudioOnly(true, this._screenshareVideoTrackIds);
|
|
@@ -3867,10 +3802,7 @@ class P2pRtcManager {
|
|
|
3867
3802
|
}
|
|
3868
3803
|
_setCodecPreferences(pc) {
|
|
3869
3804
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3870
|
-
const {
|
|
3871
|
-
if (!(p2pVp9On || p2pAv1On || redOn || preferP2pHardwareDecodingOn)) {
|
|
3872
|
-
return;
|
|
3873
|
-
}
|
|
3805
|
+
const { p2pAv1On, redOn } = this._features;
|
|
3874
3806
|
try {
|
|
3875
3807
|
const audioTransceivers = pc
|
|
3876
3808
|
.getTransceivers()
|
|
@@ -3898,13 +3830,9 @@ class P2pRtcManager {
|
|
|
3898
3830
|
if (videoTransceiver.setCodecPreferences === undefined)
|
|
3899
3831
|
return;
|
|
3900
3832
|
const capabilities = RTCRtpReceiver.getCapabilities("video");
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
av1On: p2pAv1On,
|
|
3905
|
-
preferHardwareDecodingOn: p2pVp9On || preferP2pHardwareDecodingOn,
|
|
3906
|
-
});
|
|
3907
|
-
}
|
|
3833
|
+
capabilities.codecs = yield sortCodecs(capabilities.codecs, {
|
|
3834
|
+
av1On: p2pAv1On,
|
|
3835
|
+
});
|
|
3908
3836
|
videoTransceiver.setCodecPreferences(capabilities.codecs);
|
|
3909
3837
|
})));
|
|
3910
3838
|
}
|
|
@@ -3926,14 +3854,14 @@ class P2pRtcManager {
|
|
|
3926
3854
|
return;
|
|
3927
3855
|
}
|
|
3928
3856
|
session.isOperationPending = true;
|
|
3929
|
-
const {
|
|
3857
|
+
const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
|
|
3930
3858
|
this._setCodecPreferences(pc).then(() => pc
|
|
3931
3859
|
.createOffer(constraints || this.offerOptions)
|
|
3932
3860
|
.then((offer) => {
|
|
3933
3861
|
if (rtpAbsCaptureTimeOn)
|
|
3934
3862
|
offer.sdp = addAbsCaptureTimeExtMap(offer.sdp);
|
|
3935
|
-
if (
|
|
3936
|
-
offer.sdp = setCodecPreferenceSDP(offer.sdp,
|
|
3863
|
+
if (browserName$1 === "firefox") {
|
|
3864
|
+
offer.sdp = setCodecPreferenceSDP(offer.sdp, redOn);
|
|
3937
3865
|
}
|
|
3938
3866
|
if (cleanSdpOn)
|
|
3939
3867
|
offer.sdp = cleanSdp(offer.sdp);
|
|
@@ -8031,8 +7959,6 @@ exports.EVENTS = EVENTS;
|
|
|
8031
7959
|
exports.KNOCK_MESSAGES = KNOCK_MESSAGES;
|
|
8032
7960
|
exports.KalmanFilter = KalmanFilter;
|
|
8033
7961
|
exports.Logger = Logger;
|
|
8034
|
-
exports.MAXIMUM_TURN_BANDWIDTH = MAXIMUM_TURN_BANDWIDTH;
|
|
8035
|
-
exports.MAXIMUM_TURN_BANDWIDTH_UNLIMITED = MAXIMUM_TURN_BANDWIDTH_UNLIMITED;
|
|
8036
7962
|
exports.MEDIA_JITTER_BUFFER_TARGET = MEDIA_JITTER_BUFFER_TARGET;
|
|
8037
7963
|
exports.NoDevicesError = NoDevicesError;
|
|
8038
7964
|
exports.P2pRtcManager = P2pRtcManager;
|
|
@@ -8055,9 +7981,7 @@ exports.TYPES = TYPES;
|
|
|
8055
7981
|
exports.VIDEO_SETTINGS_HD = VIDEO_SETTINGS_HD;
|
|
8056
7982
|
exports.VIDEO_SETTINGS_SD = VIDEO_SETTINGS_SD;
|
|
8057
7983
|
exports.VIDEO_SETTINGS_VP9 = VIDEO_SETTINGS_VP9;
|
|
8058
|
-
exports.VIDEO_SETTINGS_VP9_KEY = VIDEO_SETTINGS_VP9_KEY;
|
|
8059
7984
|
exports.VIDEO_SETTINGS_VP9_LOW_BANDWIDTH = VIDEO_SETTINGS_VP9_LOW_BANDWIDTH;
|
|
8060
|
-
exports.VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY = VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY;
|
|
8061
7985
|
exports.VegaConnection = VegaConnection;
|
|
8062
7986
|
exports.VegaMediaQualityMonitor = VegaMediaQualityMonitor;
|
|
8063
7987
|
exports.VegaRtcManager = VegaRtcManager;
|
|
@@ -8105,7 +8029,6 @@ exports.getUserMedia = getUserMedia;
|
|
|
8105
8029
|
exports.hasGetDisplayMedia = hasGetDisplayMedia;
|
|
8106
8030
|
exports.ipRegex = ipRegex;
|
|
8107
8031
|
exports.isMobile = isMobile;
|
|
8108
|
-
exports.isRelayed = isRelayed;
|
|
8109
8032
|
exports.maybeRejectNoH264 = maybeRejectNoH264;
|
|
8110
8033
|
exports.maybeTurnOnly = maybeTurnOnly;
|
|
8111
8034
|
exports.modifyMediaCapabilities = modifyMediaCapabilities;
|
package/dist/index.d.cts
CHANGED
|
@@ -256,8 +256,6 @@ declare class BandwidthTester extends EventEmitter {
|
|
|
256
256
|
|
|
257
257
|
declare function detectMicrophoneNotWorking(pc: any): any;
|
|
258
258
|
|
|
259
|
-
declare const MAXIMUM_TURN_BANDWIDTH = 1280;
|
|
260
|
-
declare const MAXIMUM_TURN_BANDWIDTH_UNLIMITED = -1;
|
|
261
259
|
declare const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
262
260
|
|
|
263
261
|
declare enum RtcEventNames {
|
|
@@ -486,7 +484,6 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
486
484
|
isSfu: any;
|
|
487
485
|
}): boolean;
|
|
488
486
|
supportsScreenShareAudio(): boolean;
|
|
489
|
-
maybeRestrictRelayBandwidth(session: any): void;
|
|
490
487
|
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
491
488
|
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
492
489
|
disconnectAll(): void;
|
|
@@ -633,15 +630,6 @@ declare const VIDEO_SETTINGS_VP9: {
|
|
|
633
630
|
maxBitrate: number;
|
|
634
631
|
}[];
|
|
635
632
|
};
|
|
636
|
-
declare const VIDEO_SETTINGS_VP9_KEY: {
|
|
637
|
-
codecOptions: {
|
|
638
|
-
videoGoogleStartBitrate: number;
|
|
639
|
-
};
|
|
640
|
-
encodings: {
|
|
641
|
-
scalabilityMode: string;
|
|
642
|
-
maxBitrate: number;
|
|
643
|
-
}[];
|
|
644
|
-
};
|
|
645
633
|
declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH: {
|
|
646
634
|
codecOptions: {
|
|
647
635
|
videoGoogleStartBitrate: number;
|
|
@@ -651,15 +639,6 @@ declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH: {
|
|
|
651
639
|
maxBitrate: number;
|
|
652
640
|
}[];
|
|
653
641
|
};
|
|
654
|
-
declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY: {
|
|
655
|
-
codecOptions: {
|
|
656
|
-
videoGoogleStartBitrate: number;
|
|
657
|
-
};
|
|
658
|
-
encodings: {
|
|
659
|
-
scalabilityMode: string;
|
|
660
|
-
maxBitrate: number;
|
|
661
|
-
}[];
|
|
662
|
-
};
|
|
663
642
|
declare const SCREEN_SHARE_SETTINGS: {
|
|
664
643
|
encodings: {}[];
|
|
665
644
|
};
|
|
@@ -693,7 +672,6 @@ declare const getMediaSettings: (kind: string, isScreenShare: boolean, features:
|
|
|
693
672
|
lowDataModeEnabled?: boolean;
|
|
694
673
|
simulcastScreenshareOn?: boolean;
|
|
695
674
|
vp9On?: boolean;
|
|
696
|
-
svcKeyScalabilityModeOn?: boolean;
|
|
697
675
|
}, isSomeoneAlreadyPresenting?: boolean) => {
|
|
698
676
|
encodings: {}[];
|
|
699
677
|
};
|
|
@@ -707,9 +685,7 @@ interface Codec {
|
|
|
707
685
|
sdpFmtpLine?: string;
|
|
708
686
|
}
|
|
709
687
|
declare function sortCodecs(codecs: Codec[], features: {
|
|
710
|
-
vp9On?: boolean;
|
|
711
688
|
av1On?: boolean;
|
|
712
|
-
preferHardwareDecodingOn?: boolean;
|
|
713
689
|
}): Promise<Codec[]>;
|
|
714
690
|
|
|
715
691
|
declare class ReconnectManager extends EventEmitter {
|
|
@@ -1226,7 +1202,7 @@ declare const rtcStats: {
|
|
|
1226
1202
|
};
|
|
1227
1203
|
};
|
|
1228
1204
|
|
|
1229
|
-
declare function setCodecPreferenceSDP(sdp: any,
|
|
1205
|
+
declare function setCodecPreferenceSDP(sdp: any, redOn?: boolean): string | undefined;
|
|
1230
1206
|
declare function cleanSdp(sdp: string): string;
|
|
1231
1207
|
declare function maybeRejectNoH264(sdp: any): any;
|
|
1232
1208
|
declare function deprioritizeH264(sdp: any): string;
|
|
@@ -1254,7 +1230,6 @@ declare class Session {
|
|
|
1254
1230
|
totalRecv: number;
|
|
1255
1231
|
};
|
|
1256
1232
|
bandwidth: any;
|
|
1257
|
-
maximumTurnBandwidth: any;
|
|
1258
1233
|
pending: any[];
|
|
1259
1234
|
isOperationPending: boolean;
|
|
1260
1235
|
streamIds: any[];
|
|
@@ -1272,10 +1247,9 @@ declare class Session {
|
|
|
1272
1247
|
shouldAddLocalVideo: any;
|
|
1273
1248
|
signalingState: any;
|
|
1274
1249
|
srdComplete: any;
|
|
1275
|
-
constructor({ peerConnectionId, bandwidth,
|
|
1250
|
+
constructor({ peerConnectionId, bandwidth, deprioritizeH264Encoding, }: {
|
|
1276
1251
|
peerConnectionId: any;
|
|
1277
1252
|
bandwidth: any;
|
|
1278
|
-
maximumTurnBandwidth: any;
|
|
1279
1253
|
deprioritizeH264Encoding: any;
|
|
1280
1254
|
});
|
|
1281
1255
|
setAndGetPeerConnection({ clientId, constraints, peerConnectionConfig, shouldAddLocalVideo, }: {
|
|
@@ -1296,7 +1270,6 @@ declare class Session {
|
|
|
1296
1270
|
close(): void;
|
|
1297
1271
|
hasConnectedPeerConnection(): any;
|
|
1298
1272
|
replaceTrack(oldTrack: MediaStreamTrack, newTrack: MediaStreamTrack): any;
|
|
1299
|
-
maybeRestrictRelayBandwidth(): void;
|
|
1300
1273
|
changeBandwidth(bandwidth: any): void;
|
|
1301
1274
|
setAudioOnly(enable: boolean, excludedTrackIds?: any[]): void;
|
|
1302
1275
|
}
|
|
@@ -1331,8 +1304,6 @@ declare class SfuV2Parser {
|
|
|
1331
1304
|
};
|
|
1332
1305
|
}
|
|
1333
1306
|
|
|
1334
|
-
declare function isRelayed(pc: any): any;
|
|
1335
|
-
|
|
1336
1307
|
declare class VegaConnection extends EventEmitter$1 {
|
|
1337
1308
|
wsUrl: string;
|
|
1338
1309
|
protocol: string;
|
|
@@ -1808,5 +1779,5 @@ declare class RtcStream {
|
|
|
1808
1779
|
static getTypeFromId(id: string): string;
|
|
1809
1780
|
}
|
|
1810
1781
|
|
|
1811
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger,
|
|
1782
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, 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, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
1812
1783
|
export type { AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, CannotJoinUnclaimedRoomError, ChatMessage, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, CustomMediaStreamTrack, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, NewClientEvent, OrganizationPlanExhaustedError, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomFullError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalKnocker, SignalRequests, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TrackStats, TurnTransportProtocol, UpdatedDeviceInfo, UpdatedDevicesInfo, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, ViewStats, ssrcStats };
|
package/dist/index.d.mts
CHANGED
|
@@ -256,8 +256,6 @@ declare class BandwidthTester extends EventEmitter {
|
|
|
256
256
|
|
|
257
257
|
declare function detectMicrophoneNotWorking(pc: any): any;
|
|
258
258
|
|
|
259
|
-
declare const MAXIMUM_TURN_BANDWIDTH = 1280;
|
|
260
|
-
declare const MAXIMUM_TURN_BANDWIDTH_UNLIMITED = -1;
|
|
261
259
|
declare const MEDIA_JITTER_BUFFER_TARGET = 400;
|
|
262
260
|
|
|
263
261
|
declare enum RtcEventNames {
|
|
@@ -486,7 +484,6 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
486
484
|
isSfu: any;
|
|
487
485
|
}): boolean;
|
|
488
486
|
supportsScreenShareAudio(): boolean;
|
|
489
|
-
maybeRestrictRelayBandwidth(session: any): void;
|
|
490
487
|
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
491
488
|
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
492
489
|
disconnectAll(): void;
|
|
@@ -633,15 +630,6 @@ declare const VIDEO_SETTINGS_VP9: {
|
|
|
633
630
|
maxBitrate: number;
|
|
634
631
|
}[];
|
|
635
632
|
};
|
|
636
|
-
declare const VIDEO_SETTINGS_VP9_KEY: {
|
|
637
|
-
codecOptions: {
|
|
638
|
-
videoGoogleStartBitrate: number;
|
|
639
|
-
};
|
|
640
|
-
encodings: {
|
|
641
|
-
scalabilityMode: string;
|
|
642
|
-
maxBitrate: number;
|
|
643
|
-
}[];
|
|
644
|
-
};
|
|
645
633
|
declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH: {
|
|
646
634
|
codecOptions: {
|
|
647
635
|
videoGoogleStartBitrate: number;
|
|
@@ -651,15 +639,6 @@ declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH: {
|
|
|
651
639
|
maxBitrate: number;
|
|
652
640
|
}[];
|
|
653
641
|
};
|
|
654
|
-
declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY: {
|
|
655
|
-
codecOptions: {
|
|
656
|
-
videoGoogleStartBitrate: number;
|
|
657
|
-
};
|
|
658
|
-
encodings: {
|
|
659
|
-
scalabilityMode: string;
|
|
660
|
-
maxBitrate: number;
|
|
661
|
-
}[];
|
|
662
|
-
};
|
|
663
642
|
declare const SCREEN_SHARE_SETTINGS: {
|
|
664
643
|
encodings: {}[];
|
|
665
644
|
};
|
|
@@ -693,7 +672,6 @@ declare const getMediaSettings: (kind: string, isScreenShare: boolean, features:
|
|
|
693
672
|
lowDataModeEnabled?: boolean;
|
|
694
673
|
simulcastScreenshareOn?: boolean;
|
|
695
674
|
vp9On?: boolean;
|
|
696
|
-
svcKeyScalabilityModeOn?: boolean;
|
|
697
675
|
}, isSomeoneAlreadyPresenting?: boolean) => {
|
|
698
676
|
encodings: {}[];
|
|
699
677
|
};
|
|
@@ -707,9 +685,7 @@ interface Codec {
|
|
|
707
685
|
sdpFmtpLine?: string;
|
|
708
686
|
}
|
|
709
687
|
declare function sortCodecs(codecs: Codec[], features: {
|
|
710
|
-
vp9On?: boolean;
|
|
711
688
|
av1On?: boolean;
|
|
712
|
-
preferHardwareDecodingOn?: boolean;
|
|
713
689
|
}): Promise<Codec[]>;
|
|
714
690
|
|
|
715
691
|
declare class ReconnectManager extends EventEmitter {
|
|
@@ -1226,7 +1202,7 @@ declare const rtcStats: {
|
|
|
1226
1202
|
};
|
|
1227
1203
|
};
|
|
1228
1204
|
|
|
1229
|
-
declare function setCodecPreferenceSDP(sdp: any,
|
|
1205
|
+
declare function setCodecPreferenceSDP(sdp: any, redOn?: boolean): string | undefined;
|
|
1230
1206
|
declare function cleanSdp(sdp: string): string;
|
|
1231
1207
|
declare function maybeRejectNoH264(sdp: any): any;
|
|
1232
1208
|
declare function deprioritizeH264(sdp: any): string;
|
|
@@ -1254,7 +1230,6 @@ declare class Session {
|
|
|
1254
1230
|
totalRecv: number;
|
|
1255
1231
|
};
|
|
1256
1232
|
bandwidth: any;
|
|
1257
|
-
maximumTurnBandwidth: any;
|
|
1258
1233
|
pending: any[];
|
|
1259
1234
|
isOperationPending: boolean;
|
|
1260
1235
|
streamIds: any[];
|
|
@@ -1272,10 +1247,9 @@ declare class Session {
|
|
|
1272
1247
|
shouldAddLocalVideo: any;
|
|
1273
1248
|
signalingState: any;
|
|
1274
1249
|
srdComplete: any;
|
|
1275
|
-
constructor({ peerConnectionId, bandwidth,
|
|
1250
|
+
constructor({ peerConnectionId, bandwidth, deprioritizeH264Encoding, }: {
|
|
1276
1251
|
peerConnectionId: any;
|
|
1277
1252
|
bandwidth: any;
|
|
1278
|
-
maximumTurnBandwidth: any;
|
|
1279
1253
|
deprioritizeH264Encoding: any;
|
|
1280
1254
|
});
|
|
1281
1255
|
setAndGetPeerConnection({ clientId, constraints, peerConnectionConfig, shouldAddLocalVideo, }: {
|
|
@@ -1296,7 +1270,6 @@ declare class Session {
|
|
|
1296
1270
|
close(): void;
|
|
1297
1271
|
hasConnectedPeerConnection(): any;
|
|
1298
1272
|
replaceTrack(oldTrack: MediaStreamTrack, newTrack: MediaStreamTrack): any;
|
|
1299
|
-
maybeRestrictRelayBandwidth(): void;
|
|
1300
1273
|
changeBandwidth(bandwidth: any): void;
|
|
1301
1274
|
setAudioOnly(enable: boolean, excludedTrackIds?: any[]): void;
|
|
1302
1275
|
}
|
|
@@ -1331,8 +1304,6 @@ declare class SfuV2Parser {
|
|
|
1331
1304
|
};
|
|
1332
1305
|
}
|
|
1333
1306
|
|
|
1334
|
-
declare function isRelayed(pc: any): any;
|
|
1335
|
-
|
|
1336
1307
|
declare class VegaConnection extends EventEmitter$1 {
|
|
1337
1308
|
wsUrl: string;
|
|
1338
1309
|
protocol: string;
|
|
@@ -1808,5 +1779,5 @@ declare class RtcStream {
|
|
|
1808
1779
|
static getTypeFromId(id: string): string;
|
|
1809
1780
|
}
|
|
1810
1781
|
|
|
1811
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger,
|
|
1782
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, 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, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
1812
1783
|
export type { AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, CannotJoinUnclaimedRoomError, ChatMessage, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, CustomMediaStreamTrack, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, NewClientEvent, OrganizationPlanExhaustedError, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomFullError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalKnocker, SignalRequests, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TrackStats, TurnTransportProtocol, UpdatedDeviceInfo, UpdatedDevicesInfo, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, ViewStats, ssrcStats };
|