@whereby.com/media 8.0.7 → 8.0.8
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 +14 -39
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +14 -39
- package/dist/legacy-esm.js +14 -39
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -295,7 +295,7 @@ class Logger {
|
|
|
295
295
|
|
|
296
296
|
var _a$6, _b$2;
|
|
297
297
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
298
|
-
const logger$
|
|
298
|
+
const logger$b = new Logger();
|
|
299
299
|
const browserName$2 = (_b$2 = adapter$6.browserDetails) === null || _b$2 === void 0 ? void 0 : _b$2.browser;
|
|
300
300
|
const browserVersion$1 = adapter$6.browserDetails.version;
|
|
301
301
|
function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
@@ -336,7 +336,7 @@ function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
|
336
336
|
return newSdp;
|
|
337
337
|
}
|
|
338
338
|
catch (error) {
|
|
339
|
-
logger$
|
|
339
|
+
logger$b.error("setCodecPreferenceSDP error:", error);
|
|
340
340
|
return sdp;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -487,7 +487,7 @@ function trackAnnotations(o) {
|
|
|
487
487
|
|
|
488
488
|
var _a$5;
|
|
489
489
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
490
|
-
const logger$
|
|
490
|
+
const logger$a = new Logger();
|
|
491
491
|
class Session {
|
|
492
492
|
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
493
493
|
this.relayCandidateSeen = false;
|
|
@@ -636,7 +636,7 @@ class Session {
|
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
638
|
this.pc.addIceCandidate(candidate).catch((e) => {
|
|
639
|
-
logger$
|
|
639
|
+
logger$a.warn("Failed to add ICE candidate ('%s'): %s", candidate ? candidate.candidate : null, e);
|
|
640
640
|
});
|
|
641
641
|
});
|
|
642
642
|
}
|
|
@@ -655,7 +655,7 @@ class Session {
|
|
|
655
655
|
pc.close();
|
|
656
656
|
}
|
|
657
657
|
catch (e) {
|
|
658
|
-
logger$
|
|
658
|
+
logger$a.warn("failures during close of session", e);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
hasConnectedPeerConnection() {
|
|
@@ -663,7 +663,7 @@ class Session {
|
|
|
663
663
|
}
|
|
664
664
|
replaceTrack(oldTrack, newTrack) {
|
|
665
665
|
return __awaiter(this, void 0, void 0, function* () {
|
|
666
|
-
logger$
|
|
666
|
+
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
667
667
|
if (newTrack.readyState === "ended") {
|
|
668
668
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
669
669
|
}
|
|
@@ -1064,7 +1064,7 @@ const getMediasoupDeviceAsync = (features) => __awaiter(void 0, void 0, void 0,
|
|
|
1064
1064
|
return new mediasoupClient.Device({ handlerName });
|
|
1065
1065
|
});
|
|
1066
1066
|
|
|
1067
|
-
const logger$
|
|
1067
|
+
const logger$9 = new Logger();
|
|
1068
1068
|
const AUDIO_SETTINGS = {
|
|
1069
1069
|
codecOptions: {
|
|
1070
1070
|
opusDtx: true,
|
|
@@ -1244,7 +1244,7 @@ function sortCodecsByPowerEfficiency(codecs) {
|
|
|
1244
1244
|
codecPowerEfficiencyEntries = yield Promise.all(codecs.map(({ mimeType }) => getIsCodecDecodingPowerEfficient(mimeType).then((val) => [mimeType, val])));
|
|
1245
1245
|
}
|
|
1246
1246
|
catch (error) {
|
|
1247
|
-
logger$
|
|
1247
|
+
logger$9.error(error);
|
|
1248
1248
|
return codecs;
|
|
1249
1249
|
}
|
|
1250
1250
|
const codecPowerEfficiencies = Object.fromEntries(codecPowerEfficiencyEntries);
|
|
@@ -1734,42 +1734,17 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
|
|
1737
|
-
const
|
|
1738
|
-
function registerOriginTrials(trials, registeredTrials = REGISTERED_TRIALS, document = window.document) {
|
|
1739
|
-
trials.forEach(({ hostnamePattern, token }) => {
|
|
1740
|
-
const key = `${hostnamePattern}-${token}`;
|
|
1741
|
-
if (registeredTrials[key]) {
|
|
1742
|
-
return;
|
|
1743
|
-
}
|
|
1744
|
-
if (hostnamePattern.test(document.location.hostname)) {
|
|
1745
|
-
const otMeta = document.createElement("meta");
|
|
1746
|
-
otMeta.httpEquiv = "origin-trial";
|
|
1747
|
-
otMeta.content = token;
|
|
1748
|
-
document.head.append(otMeta);
|
|
1749
|
-
registeredTrials[key] = true;
|
|
1750
|
-
}
|
|
1751
|
-
});
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1737
|
+
const logger$8 = new Logger();
|
|
1754
1738
|
const CPU_OBSERVER_OPTIONS = {
|
|
1755
1739
|
sampleRate: 1,
|
|
1756
|
-
originTrials: [
|
|
1757
|
-
{
|
|
1758
|
-
hostnamePattern: /hereby\.dev/,
|
|
1759
|
-
token: "AkSNPHJw6EK08X0QU7kORnK9NABzRLAC7dqfXOwk5JwFAQG4Ey7WxLXxsnhieCgC1QHUdevE2EFICy7uBGDANwUAAABqeyJvcmlnaW4iOiJodHRwczovL2hlcmVieS5kZXY6NDQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1760
|
-
},
|
|
1761
|
-
{
|
|
1762
|
-
hostnamePattern: /whereby\.com/,
|
|
1763
|
-
token: "Asc2wu8KpSx648i932NICteQDFcB05yl2QUUSHD7AQo8JGP2Fp6FF91TvYVJBsKGzLMH349rysPw5q9tqPC/PAUAAABqeyJvcmlnaW4iOiJodHRwczovL3doZXJlYnkuY29tOjQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1764
|
-
},
|
|
1765
|
-
],
|
|
1766
1740
|
};
|
|
1767
|
-
function startCpuObserver(cb, { sampleRate,
|
|
1768
|
-
|
|
1741
|
+
function startCpuObserver(cb, { sampleRate, } = CPU_OBSERVER_OPTIONS, window = globalThis.window) {
|
|
1742
|
+
var _a;
|
|
1769
1743
|
let pressureObserver;
|
|
1770
|
-
if ("PressureObserver" in window
|
|
1744
|
+
if ("PressureObserver" in window &&
|
|
1745
|
+
(window.PressureObserver.knownSources || []).includes("cpu")) {
|
|
1771
1746
|
pressureObserver = new window.PressureObserver(cb, { sampleRate });
|
|
1772
|
-
pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 });
|
|
1747
|
+
(_a = pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 })) === null || _a === void 0 ? void 0 : _a.catch(logger$8.error);
|
|
1773
1748
|
return {
|
|
1774
1749
|
stop: () => {
|
|
1775
1750
|
pressureObserver.unobserve("cpu");
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -274,7 +274,7 @@ class Logger {
|
|
|
274
274
|
|
|
275
275
|
var _a$6, _b$2;
|
|
276
276
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
277
|
-
const logger$
|
|
277
|
+
const logger$b = new Logger();
|
|
278
278
|
const browserName$2 = (_b$2 = adapter$6.browserDetails) === null || _b$2 === void 0 ? void 0 : _b$2.browser;
|
|
279
279
|
const browserVersion$1 = adapter$6.browserDetails.version;
|
|
280
280
|
function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
@@ -315,7 +315,7 @@ function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
|
315
315
|
return newSdp;
|
|
316
316
|
}
|
|
317
317
|
catch (error) {
|
|
318
|
-
logger$
|
|
318
|
+
logger$b.error("setCodecPreferenceSDP error:", error);
|
|
319
319
|
return sdp;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
@@ -466,7 +466,7 @@ function trackAnnotations(o) {
|
|
|
466
466
|
|
|
467
467
|
var _a$5;
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
|
-
const logger$
|
|
469
|
+
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
471
|
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
@@ -615,7 +615,7 @@ class Session {
|
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
617
|
this.pc.addIceCandidate(candidate).catch((e) => {
|
|
618
|
-
logger$
|
|
618
|
+
logger$a.warn("Failed to add ICE candidate ('%s'): %s", candidate ? candidate.candidate : null, e);
|
|
619
619
|
});
|
|
620
620
|
});
|
|
621
621
|
}
|
|
@@ -634,7 +634,7 @@ class Session {
|
|
|
634
634
|
pc.close();
|
|
635
635
|
}
|
|
636
636
|
catch (e) {
|
|
637
|
-
logger$
|
|
637
|
+
logger$a.warn("failures during close of session", e);
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
hasConnectedPeerConnection() {
|
|
@@ -642,7 +642,7 @@ class Session {
|
|
|
642
642
|
}
|
|
643
643
|
replaceTrack(oldTrack, newTrack) {
|
|
644
644
|
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
-
logger$
|
|
645
|
+
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
646
|
if (newTrack.readyState === "ended") {
|
|
647
647
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
648
|
}
|
|
@@ -1043,7 +1043,7 @@ const getMediasoupDeviceAsync = (features) => __awaiter(void 0, void 0, void 0,
|
|
|
1043
1043
|
return new Device({ handlerName });
|
|
1044
1044
|
});
|
|
1045
1045
|
|
|
1046
|
-
const logger$
|
|
1046
|
+
const logger$9 = new Logger();
|
|
1047
1047
|
const AUDIO_SETTINGS = {
|
|
1048
1048
|
codecOptions: {
|
|
1049
1049
|
opusDtx: true,
|
|
@@ -1223,7 +1223,7 @@ function sortCodecsByPowerEfficiency(codecs) {
|
|
|
1223
1223
|
codecPowerEfficiencyEntries = yield Promise.all(codecs.map(({ mimeType }) => getIsCodecDecodingPowerEfficient(mimeType).then((val) => [mimeType, val])));
|
|
1224
1224
|
}
|
|
1225
1225
|
catch (error) {
|
|
1226
|
-
logger$
|
|
1226
|
+
logger$9.error(error);
|
|
1227
1227
|
return codecs;
|
|
1228
1228
|
}
|
|
1229
1229
|
const codecPowerEfficiencies = Object.fromEntries(codecPowerEfficiencyEntries);
|
|
@@ -1713,42 +1713,17 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
1715
|
|
|
1716
|
-
const
|
|
1717
|
-
function registerOriginTrials(trials, registeredTrials = REGISTERED_TRIALS, document = window.document) {
|
|
1718
|
-
trials.forEach(({ hostnamePattern, token }) => {
|
|
1719
|
-
const key = `${hostnamePattern}-${token}`;
|
|
1720
|
-
if (registeredTrials[key]) {
|
|
1721
|
-
return;
|
|
1722
|
-
}
|
|
1723
|
-
if (hostnamePattern.test(document.location.hostname)) {
|
|
1724
|
-
const otMeta = document.createElement("meta");
|
|
1725
|
-
otMeta.httpEquiv = "origin-trial";
|
|
1726
|
-
otMeta.content = token;
|
|
1727
|
-
document.head.append(otMeta);
|
|
1728
|
-
registeredTrials[key] = true;
|
|
1729
|
-
}
|
|
1730
|
-
});
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1716
|
+
const logger$8 = new Logger();
|
|
1733
1717
|
const CPU_OBSERVER_OPTIONS = {
|
|
1734
1718
|
sampleRate: 1,
|
|
1735
|
-
originTrials: [
|
|
1736
|
-
{
|
|
1737
|
-
hostnamePattern: /hereby\.dev/,
|
|
1738
|
-
token: "AkSNPHJw6EK08X0QU7kORnK9NABzRLAC7dqfXOwk5JwFAQG4Ey7WxLXxsnhieCgC1QHUdevE2EFICy7uBGDANwUAAABqeyJvcmlnaW4iOiJodHRwczovL2hlcmVieS5kZXY6NDQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1739
|
-
},
|
|
1740
|
-
{
|
|
1741
|
-
hostnamePattern: /whereby\.com/,
|
|
1742
|
-
token: "Asc2wu8KpSx648i932NICteQDFcB05yl2QUUSHD7AQo8JGP2Fp6FF91TvYVJBsKGzLMH349rysPw5q9tqPC/PAUAAABqeyJvcmlnaW4iOiJodHRwczovL3doZXJlYnkuY29tOjQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1743
|
-
},
|
|
1744
|
-
],
|
|
1745
1719
|
};
|
|
1746
|
-
function startCpuObserver(cb, { sampleRate,
|
|
1747
|
-
|
|
1720
|
+
function startCpuObserver(cb, { sampleRate, } = CPU_OBSERVER_OPTIONS, window = globalThis.window) {
|
|
1721
|
+
var _a;
|
|
1748
1722
|
let pressureObserver;
|
|
1749
|
-
if ("PressureObserver" in window
|
|
1723
|
+
if ("PressureObserver" in window &&
|
|
1724
|
+
(window.PressureObserver.knownSources || []).includes("cpu")) {
|
|
1750
1725
|
pressureObserver = new window.PressureObserver(cb, { sampleRate });
|
|
1751
|
-
pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 });
|
|
1726
|
+
(_a = pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 })) === null || _a === void 0 ? void 0 : _a.catch(logger$8.error);
|
|
1752
1727
|
return {
|
|
1753
1728
|
stop: () => {
|
|
1754
1729
|
pressureObserver.unobserve("cpu");
|
package/dist/legacy-esm.js
CHANGED
|
@@ -274,7 +274,7 @@ class Logger {
|
|
|
274
274
|
|
|
275
275
|
var _a$6, _b$2;
|
|
276
276
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
277
|
-
const logger$
|
|
277
|
+
const logger$b = new Logger();
|
|
278
278
|
const browserName$2 = (_b$2 = adapter$6.browserDetails) === null || _b$2 === void 0 ? void 0 : _b$2.browser;
|
|
279
279
|
const browserVersion$1 = adapter$6.browserDetails.version;
|
|
280
280
|
function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
@@ -315,7 +315,7 @@ function setCodecPreferenceSDP({ sdp, redOn }) {
|
|
|
315
315
|
return newSdp;
|
|
316
316
|
}
|
|
317
317
|
catch (error) {
|
|
318
|
-
logger$
|
|
318
|
+
logger$b.error("setCodecPreferenceSDP error:", error);
|
|
319
319
|
return sdp;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
@@ -466,7 +466,7 @@ function trackAnnotations(o) {
|
|
|
466
466
|
|
|
467
467
|
var _a$5;
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
|
-
const logger$
|
|
469
|
+
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
471
|
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
@@ -615,7 +615,7 @@ class Session {
|
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
617
|
this.pc.addIceCandidate(candidate).catch((e) => {
|
|
618
|
-
logger$
|
|
618
|
+
logger$a.warn("Failed to add ICE candidate ('%s'): %s", candidate ? candidate.candidate : null, e);
|
|
619
619
|
});
|
|
620
620
|
});
|
|
621
621
|
}
|
|
@@ -634,7 +634,7 @@ class Session {
|
|
|
634
634
|
pc.close();
|
|
635
635
|
}
|
|
636
636
|
catch (e) {
|
|
637
|
-
logger$
|
|
637
|
+
logger$a.warn("failures during close of session", e);
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
hasConnectedPeerConnection() {
|
|
@@ -642,7 +642,7 @@ class Session {
|
|
|
642
642
|
}
|
|
643
643
|
replaceTrack(oldTrack, newTrack) {
|
|
644
644
|
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
-
logger$
|
|
645
|
+
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
646
|
if (newTrack.readyState === "ended") {
|
|
647
647
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
648
|
}
|
|
@@ -1043,7 +1043,7 @@ const getMediasoupDeviceAsync = (features) => __awaiter(void 0, void 0, void 0,
|
|
|
1043
1043
|
return new Device({ handlerName });
|
|
1044
1044
|
});
|
|
1045
1045
|
|
|
1046
|
-
const logger$
|
|
1046
|
+
const logger$9 = new Logger();
|
|
1047
1047
|
const AUDIO_SETTINGS = {
|
|
1048
1048
|
codecOptions: {
|
|
1049
1049
|
opusDtx: true,
|
|
@@ -1223,7 +1223,7 @@ function sortCodecsByPowerEfficiency(codecs) {
|
|
|
1223
1223
|
codecPowerEfficiencyEntries = yield Promise.all(codecs.map(({ mimeType }) => getIsCodecDecodingPowerEfficient(mimeType).then((val) => [mimeType, val])));
|
|
1224
1224
|
}
|
|
1225
1225
|
catch (error) {
|
|
1226
|
-
logger$
|
|
1226
|
+
logger$9.error(error);
|
|
1227
1227
|
return codecs;
|
|
1228
1228
|
}
|
|
1229
1229
|
const codecPowerEfficiencies = Object.fromEntries(codecPowerEfficiencyEntries);
|
|
@@ -1713,42 +1713,17 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
1715
|
|
|
1716
|
-
const
|
|
1717
|
-
function registerOriginTrials(trials, registeredTrials = REGISTERED_TRIALS, document = window.document) {
|
|
1718
|
-
trials.forEach(({ hostnamePattern, token }) => {
|
|
1719
|
-
const key = `${hostnamePattern}-${token}`;
|
|
1720
|
-
if (registeredTrials[key]) {
|
|
1721
|
-
return;
|
|
1722
|
-
}
|
|
1723
|
-
if (hostnamePattern.test(document.location.hostname)) {
|
|
1724
|
-
const otMeta = document.createElement("meta");
|
|
1725
|
-
otMeta.httpEquiv = "origin-trial";
|
|
1726
|
-
otMeta.content = token;
|
|
1727
|
-
document.head.append(otMeta);
|
|
1728
|
-
registeredTrials[key] = true;
|
|
1729
|
-
}
|
|
1730
|
-
});
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1716
|
+
const logger$8 = new Logger();
|
|
1733
1717
|
const CPU_OBSERVER_OPTIONS = {
|
|
1734
1718
|
sampleRate: 1,
|
|
1735
|
-
originTrials: [
|
|
1736
|
-
{
|
|
1737
|
-
hostnamePattern: /hereby\.dev/,
|
|
1738
|
-
token: "AkSNPHJw6EK08X0QU7kORnK9NABzRLAC7dqfXOwk5JwFAQG4Ey7WxLXxsnhieCgC1QHUdevE2EFICy7uBGDANwUAAABqeyJvcmlnaW4iOiJodHRwczovL2hlcmVieS5kZXY6NDQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1739
|
-
},
|
|
1740
|
-
{
|
|
1741
|
-
hostnamePattern: /whereby\.com/,
|
|
1742
|
-
token: "Asc2wu8KpSx648i932NICteQDFcB05yl2QUUSHD7AQo8JGP2Fp6FF91TvYVJBsKGzLMH349rysPw5q9tqPC/PAUAAABqeyJvcmlnaW4iOiJodHRwczovL3doZXJlYnkuY29tOjQ0MyIsImZlYXR1cmUiOiJDb21wdXRlUHJlc3N1cmVfdjIiLCJleHBpcnkiOjE3MTY5NDA3OTksImlzU3ViZG9tYWluIjp0cnVlfQ==",
|
|
1743
|
-
},
|
|
1744
|
-
],
|
|
1745
1719
|
};
|
|
1746
|
-
function startCpuObserver(cb, { sampleRate,
|
|
1747
|
-
|
|
1720
|
+
function startCpuObserver(cb, { sampleRate, } = CPU_OBSERVER_OPTIONS, window = globalThis.window) {
|
|
1721
|
+
var _a;
|
|
1748
1722
|
let pressureObserver;
|
|
1749
|
-
if ("PressureObserver" in window
|
|
1723
|
+
if ("PressureObserver" in window &&
|
|
1724
|
+
(window.PressureObserver.knownSources || []).includes("cpu")) {
|
|
1750
1725
|
pressureObserver = new window.PressureObserver(cb, { sampleRate });
|
|
1751
|
-
pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 });
|
|
1726
|
+
(_a = pressureObserver.observe("cpu", { sampleInterval: sampleRate * 1000 })) === null || _a === void 0 ? void 0 : _a.catch(logger$8.error);
|
|
1752
1727
|
return {
|
|
1753
1728
|
stop: () => {
|
|
1754
1729
|
pressureObserver.unobserve("cpu");
|