@whereby.com/media 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +24 -19
- package/dist/index.d.cts +4 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +24 -19
- package/dist/legacy-esm.js +24 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1566,6 +1566,7 @@ var _a$6;
|
|
|
1566
1566
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
1567
1567
|
const DEFAULT_SOCKET_PATH = "/protocol/socket.io/v4";
|
|
1568
1568
|
const NOOP_KEEPALIVE_INTERVAL = 2000;
|
|
1569
|
+
const DISCONNECT_DURATION_LIMIT_MS = 60000;
|
|
1569
1570
|
class ServerSocket {
|
|
1570
1571
|
constructor(hostName, optionsOverrides, glitchFree = false, disconnectDurationLimitOn = false) {
|
|
1571
1572
|
this._wasConnectedUsingWebsocket = false;
|
|
@@ -1573,21 +1574,22 @@ class ServerSocket {
|
|
|
1573
1574
|
this.disconnectDurationLimitExceeded = false;
|
|
1574
1575
|
this._reconnectManager = null;
|
|
1575
1576
|
this._socket = socket_ioClient.io(hostName, Object.assign({ path: DEFAULT_SOCKET_PATH, randomizationFactor: 0.5, reconnectionDelay: 250, reconnectionDelayMax: 5000, timeout: 5000, transports: ["websocket"], withCredentials: true }, optionsOverrides));
|
|
1577
|
+
this._disconnectDurationLimitEnabled = false;
|
|
1576
1578
|
this.joinRoomFinished = false;
|
|
1577
1579
|
this._socket.io.on("reconnect", () => {
|
|
1578
|
-
if (this._disconnectDurationLimitOn &&
|
|
1580
|
+
if (this._disconnectDurationLimitOn &&
|
|
1581
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1579
1582
|
this._socket.close();
|
|
1580
1583
|
this.disconnectDurationLimitExceeded = true;
|
|
1581
|
-
return;
|
|
1582
1584
|
}
|
|
1583
1585
|
this._socket.sendBuffer = [];
|
|
1584
1586
|
});
|
|
1585
1587
|
this._socket.io.on("reconnect_attempt", () => {
|
|
1586
1588
|
var _a;
|
|
1587
|
-
if (this._disconnectDurationLimitOn &&
|
|
1589
|
+
if (this._disconnectDurationLimitOn &&
|
|
1590
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1588
1591
|
this._socket.close();
|
|
1589
1592
|
this.disconnectDurationLimitExceeded = true;
|
|
1590
|
-
return;
|
|
1591
1593
|
}
|
|
1592
1594
|
if (this._wasConnectedUsingWebsocket) {
|
|
1593
1595
|
this._socket.io.opts.transports = ["websocket"];
|
|
@@ -1611,25 +1613,30 @@ class ServerSocket {
|
|
|
1611
1613
|
const transport = this.getTransport();
|
|
1612
1614
|
if (transport === "websocket") {
|
|
1613
1615
|
this._wasConnectedUsingWebsocket = true;
|
|
1614
|
-
if (!this.noopKeepaliveInterval)
|
|
1616
|
+
if (!this.noopKeepaliveInterval) {
|
|
1617
|
+
let disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1615
1618
|
this.noopKeepaliveInterval = setInterval(() => {
|
|
1616
1619
|
try {
|
|
1617
1620
|
if (this._socket.connected) {
|
|
1618
|
-
if (this._disconnectDurationLimitOn
|
|
1619
|
-
this.
|
|
1621
|
+
if (this._disconnectDurationLimitOn &&
|
|
1622
|
+
!this._didExceedDisconnectDurationLimit(disconnectDurationLimitTimestampCandidate)) {
|
|
1623
|
+
this._disconnectDurationLimitLatestTimestamp =
|
|
1624
|
+
disconnectDurationLimitTimestampCandidate;
|
|
1625
|
+
disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1620
1626
|
}
|
|
1621
1627
|
this._socket.io.engine.sendPacket("noop");
|
|
1622
1628
|
}
|
|
1623
1629
|
}
|
|
1624
1630
|
catch (ex) { }
|
|
1625
1631
|
}, NOOP_KEEPALIVE_INTERVAL);
|
|
1632
|
+
}
|
|
1626
1633
|
}
|
|
1627
1634
|
});
|
|
1628
1635
|
this._socket.on("disconnect", () => {
|
|
1629
|
-
if (this._disconnectDurationLimitOn &&
|
|
1636
|
+
if (this._disconnectDurationLimitOn &&
|
|
1637
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1630
1638
|
this._socket.close();
|
|
1631
1639
|
this.disconnectDurationLimitExceeded = true;
|
|
1632
|
-
return;
|
|
1633
1640
|
}
|
|
1634
1641
|
this.joinRoomFinished = false;
|
|
1635
1642
|
this.disconnectTimestamp = Date.now();
|
|
@@ -1639,20 +1646,18 @@ class ServerSocket {
|
|
|
1639
1646
|
}
|
|
1640
1647
|
});
|
|
1641
1648
|
}
|
|
1642
|
-
_didExceedDisconnectDurationLimit() {
|
|
1643
|
-
if (!this._disconnectDurationLimitOn)
|
|
1644
|
-
return false;
|
|
1645
|
-
if (this._disconnectDurationLimitInMs && this._noopKeepaliveTimestamp) {
|
|
1646
|
-
const disconnectedDuration = Date.now() - this._noopKeepaliveTimestamp;
|
|
1647
|
-
if (disconnectedDuration > this._disconnectDurationLimitInMs) {
|
|
1648
|
-
return true;
|
|
1649
|
-
}
|
|
1649
|
+
_didExceedDisconnectDurationLimit(timestamp) {
|
|
1650
|
+
if (!timestamp || !this._disconnectDurationLimitOn || !this._disconnectDurationLimitEnabled)
|
|
1650
1651
|
return false;
|
|
1652
|
+
const disconnectedDuration = Date.now() - timestamp;
|
|
1653
|
+
if (disconnectedDuration > DISCONNECT_DURATION_LIMIT_MS) {
|
|
1654
|
+
return true;
|
|
1651
1655
|
}
|
|
1656
|
+
return false;
|
|
1652
1657
|
}
|
|
1653
|
-
|
|
1658
|
+
enableDisconnectDurationLimit() {
|
|
1654
1659
|
if (this._disconnectDurationLimitOn) {
|
|
1655
|
-
this.
|
|
1660
|
+
this._disconnectDurationLimitEnabled = true;
|
|
1656
1661
|
}
|
|
1657
1662
|
}
|
|
1658
1663
|
setRtcManager(rtcManager) {
|
package/dist/index.d.cts
CHANGED
|
@@ -708,16 +708,17 @@ declare class ServerSocket {
|
|
|
708
708
|
_socket: any;
|
|
709
709
|
_reconnectManager?: ReconnectManager | null;
|
|
710
710
|
noopKeepaliveInterval: any;
|
|
711
|
-
_noopKeepaliveTimestamp: number | undefined;
|
|
712
711
|
_wasConnectedUsingWebsocket?: boolean;
|
|
713
712
|
disconnectTimestamp: number | undefined;
|
|
714
713
|
disconnectDurationLimitExceeded: boolean;
|
|
715
714
|
joinRoomFinished: boolean;
|
|
716
715
|
_disconnectDurationLimitOn: boolean;
|
|
716
|
+
_disconnectDurationLimitEnabled: boolean;
|
|
717
717
|
_disconnectDurationLimitInMs: number | undefined;
|
|
718
|
+
_disconnectDurationLimitLatestTimestamp: number | undefined;
|
|
718
719
|
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean, disconnectDurationLimitOn?: boolean);
|
|
719
|
-
_didExceedDisconnectDurationLimit(
|
|
720
|
-
|
|
720
|
+
_didExceedDisconnectDurationLimit(timestamp: number | undefined): boolean;
|
|
721
|
+
enableDisconnectDurationLimit(): void;
|
|
721
722
|
setRtcManager(rtcManager?: RtcManager): void;
|
|
722
723
|
connect(): void;
|
|
723
724
|
disconnect(): void;
|
package/dist/index.d.mts
CHANGED
|
@@ -708,16 +708,17 @@ declare class ServerSocket {
|
|
|
708
708
|
_socket: any;
|
|
709
709
|
_reconnectManager?: ReconnectManager | null;
|
|
710
710
|
noopKeepaliveInterval: any;
|
|
711
|
-
_noopKeepaliveTimestamp: number | undefined;
|
|
712
711
|
_wasConnectedUsingWebsocket?: boolean;
|
|
713
712
|
disconnectTimestamp: number | undefined;
|
|
714
713
|
disconnectDurationLimitExceeded: boolean;
|
|
715
714
|
joinRoomFinished: boolean;
|
|
716
715
|
_disconnectDurationLimitOn: boolean;
|
|
716
|
+
_disconnectDurationLimitEnabled: boolean;
|
|
717
717
|
_disconnectDurationLimitInMs: number | undefined;
|
|
718
|
+
_disconnectDurationLimitLatestTimestamp: number | undefined;
|
|
718
719
|
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean, disconnectDurationLimitOn?: boolean);
|
|
719
|
-
_didExceedDisconnectDurationLimit(
|
|
720
|
-
|
|
720
|
+
_didExceedDisconnectDurationLimit(timestamp: number | undefined): boolean;
|
|
721
|
+
enableDisconnectDurationLimit(): void;
|
|
721
722
|
setRtcManager(rtcManager?: RtcManager): void;
|
|
722
723
|
connect(): void;
|
|
723
724
|
disconnect(): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -708,16 +708,17 @@ declare class ServerSocket {
|
|
|
708
708
|
_socket: any;
|
|
709
709
|
_reconnectManager?: ReconnectManager | null;
|
|
710
710
|
noopKeepaliveInterval: any;
|
|
711
|
-
_noopKeepaliveTimestamp: number | undefined;
|
|
712
711
|
_wasConnectedUsingWebsocket?: boolean;
|
|
713
712
|
disconnectTimestamp: number | undefined;
|
|
714
713
|
disconnectDurationLimitExceeded: boolean;
|
|
715
714
|
joinRoomFinished: boolean;
|
|
716
715
|
_disconnectDurationLimitOn: boolean;
|
|
716
|
+
_disconnectDurationLimitEnabled: boolean;
|
|
717
717
|
_disconnectDurationLimitInMs: number | undefined;
|
|
718
|
+
_disconnectDurationLimitLatestTimestamp: number | undefined;
|
|
718
719
|
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean, disconnectDurationLimitOn?: boolean);
|
|
719
|
-
_didExceedDisconnectDurationLimit(
|
|
720
|
-
|
|
720
|
+
_didExceedDisconnectDurationLimit(timestamp: number | undefined): boolean;
|
|
721
|
+
enableDisconnectDurationLimit(): void;
|
|
721
722
|
setRtcManager(rtcManager?: RtcManager): void;
|
|
722
723
|
connect(): void;
|
|
723
724
|
disconnect(): void;
|
package/dist/index.mjs
CHANGED
|
@@ -1545,6 +1545,7 @@ var _a$6;
|
|
|
1545
1545
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
1546
1546
|
const DEFAULT_SOCKET_PATH = "/protocol/socket.io/v4";
|
|
1547
1547
|
const NOOP_KEEPALIVE_INTERVAL = 2000;
|
|
1548
|
+
const DISCONNECT_DURATION_LIMIT_MS = 60000;
|
|
1548
1549
|
class ServerSocket {
|
|
1549
1550
|
constructor(hostName, optionsOverrides, glitchFree = false, disconnectDurationLimitOn = false) {
|
|
1550
1551
|
this._wasConnectedUsingWebsocket = false;
|
|
@@ -1552,21 +1553,22 @@ class ServerSocket {
|
|
|
1552
1553
|
this.disconnectDurationLimitExceeded = false;
|
|
1553
1554
|
this._reconnectManager = null;
|
|
1554
1555
|
this._socket = io(hostName, Object.assign({ path: DEFAULT_SOCKET_PATH, randomizationFactor: 0.5, reconnectionDelay: 250, reconnectionDelayMax: 5000, timeout: 5000, transports: ["websocket"], withCredentials: true }, optionsOverrides));
|
|
1556
|
+
this._disconnectDurationLimitEnabled = false;
|
|
1555
1557
|
this.joinRoomFinished = false;
|
|
1556
1558
|
this._socket.io.on("reconnect", () => {
|
|
1557
|
-
if (this._disconnectDurationLimitOn &&
|
|
1559
|
+
if (this._disconnectDurationLimitOn &&
|
|
1560
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1558
1561
|
this._socket.close();
|
|
1559
1562
|
this.disconnectDurationLimitExceeded = true;
|
|
1560
|
-
return;
|
|
1561
1563
|
}
|
|
1562
1564
|
this._socket.sendBuffer = [];
|
|
1563
1565
|
});
|
|
1564
1566
|
this._socket.io.on("reconnect_attempt", () => {
|
|
1565
1567
|
var _a;
|
|
1566
|
-
if (this._disconnectDurationLimitOn &&
|
|
1568
|
+
if (this._disconnectDurationLimitOn &&
|
|
1569
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1567
1570
|
this._socket.close();
|
|
1568
1571
|
this.disconnectDurationLimitExceeded = true;
|
|
1569
|
-
return;
|
|
1570
1572
|
}
|
|
1571
1573
|
if (this._wasConnectedUsingWebsocket) {
|
|
1572
1574
|
this._socket.io.opts.transports = ["websocket"];
|
|
@@ -1590,25 +1592,30 @@ class ServerSocket {
|
|
|
1590
1592
|
const transport = this.getTransport();
|
|
1591
1593
|
if (transport === "websocket") {
|
|
1592
1594
|
this._wasConnectedUsingWebsocket = true;
|
|
1593
|
-
if (!this.noopKeepaliveInterval)
|
|
1595
|
+
if (!this.noopKeepaliveInterval) {
|
|
1596
|
+
let disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1594
1597
|
this.noopKeepaliveInterval = setInterval(() => {
|
|
1595
1598
|
try {
|
|
1596
1599
|
if (this._socket.connected) {
|
|
1597
|
-
if (this._disconnectDurationLimitOn
|
|
1598
|
-
this.
|
|
1600
|
+
if (this._disconnectDurationLimitOn &&
|
|
1601
|
+
!this._didExceedDisconnectDurationLimit(disconnectDurationLimitTimestampCandidate)) {
|
|
1602
|
+
this._disconnectDurationLimitLatestTimestamp =
|
|
1603
|
+
disconnectDurationLimitTimestampCandidate;
|
|
1604
|
+
disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1599
1605
|
}
|
|
1600
1606
|
this._socket.io.engine.sendPacket("noop");
|
|
1601
1607
|
}
|
|
1602
1608
|
}
|
|
1603
1609
|
catch (ex) { }
|
|
1604
1610
|
}, NOOP_KEEPALIVE_INTERVAL);
|
|
1611
|
+
}
|
|
1605
1612
|
}
|
|
1606
1613
|
});
|
|
1607
1614
|
this._socket.on("disconnect", () => {
|
|
1608
|
-
if (this._disconnectDurationLimitOn &&
|
|
1615
|
+
if (this._disconnectDurationLimitOn &&
|
|
1616
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1609
1617
|
this._socket.close();
|
|
1610
1618
|
this.disconnectDurationLimitExceeded = true;
|
|
1611
|
-
return;
|
|
1612
1619
|
}
|
|
1613
1620
|
this.joinRoomFinished = false;
|
|
1614
1621
|
this.disconnectTimestamp = Date.now();
|
|
@@ -1618,20 +1625,18 @@ class ServerSocket {
|
|
|
1618
1625
|
}
|
|
1619
1626
|
});
|
|
1620
1627
|
}
|
|
1621
|
-
_didExceedDisconnectDurationLimit() {
|
|
1622
|
-
if (!this._disconnectDurationLimitOn)
|
|
1623
|
-
return false;
|
|
1624
|
-
if (this._disconnectDurationLimitInMs && this._noopKeepaliveTimestamp) {
|
|
1625
|
-
const disconnectedDuration = Date.now() - this._noopKeepaliveTimestamp;
|
|
1626
|
-
if (disconnectedDuration > this._disconnectDurationLimitInMs) {
|
|
1627
|
-
return true;
|
|
1628
|
-
}
|
|
1628
|
+
_didExceedDisconnectDurationLimit(timestamp) {
|
|
1629
|
+
if (!timestamp || !this._disconnectDurationLimitOn || !this._disconnectDurationLimitEnabled)
|
|
1629
1630
|
return false;
|
|
1631
|
+
const disconnectedDuration = Date.now() - timestamp;
|
|
1632
|
+
if (disconnectedDuration > DISCONNECT_DURATION_LIMIT_MS) {
|
|
1633
|
+
return true;
|
|
1630
1634
|
}
|
|
1635
|
+
return false;
|
|
1631
1636
|
}
|
|
1632
|
-
|
|
1637
|
+
enableDisconnectDurationLimit() {
|
|
1633
1638
|
if (this._disconnectDurationLimitOn) {
|
|
1634
|
-
this.
|
|
1639
|
+
this._disconnectDurationLimitEnabled = true;
|
|
1635
1640
|
}
|
|
1636
1641
|
}
|
|
1637
1642
|
setRtcManager(rtcManager) {
|
package/dist/legacy-esm.js
CHANGED
|
@@ -1545,6 +1545,7 @@ var _a$6;
|
|
|
1545
1545
|
const adapter$6 = (_a$6 = adapterRaw.default) !== null && _a$6 !== void 0 ? _a$6 : adapterRaw;
|
|
1546
1546
|
const DEFAULT_SOCKET_PATH = "/protocol/socket.io/v4";
|
|
1547
1547
|
const NOOP_KEEPALIVE_INTERVAL = 2000;
|
|
1548
|
+
const DISCONNECT_DURATION_LIMIT_MS = 60000;
|
|
1548
1549
|
class ServerSocket {
|
|
1549
1550
|
constructor(hostName, optionsOverrides, glitchFree = false, disconnectDurationLimitOn = false) {
|
|
1550
1551
|
this._wasConnectedUsingWebsocket = false;
|
|
@@ -1552,21 +1553,22 @@ class ServerSocket {
|
|
|
1552
1553
|
this.disconnectDurationLimitExceeded = false;
|
|
1553
1554
|
this._reconnectManager = null;
|
|
1554
1555
|
this._socket = io(hostName, Object.assign({ path: DEFAULT_SOCKET_PATH, randomizationFactor: 0.5, reconnectionDelay: 250, reconnectionDelayMax: 5000, timeout: 5000, transports: ["websocket"], withCredentials: true }, optionsOverrides));
|
|
1556
|
+
this._disconnectDurationLimitEnabled = false;
|
|
1555
1557
|
this.joinRoomFinished = false;
|
|
1556
1558
|
this._socket.io.on("reconnect", () => {
|
|
1557
|
-
if (this._disconnectDurationLimitOn &&
|
|
1559
|
+
if (this._disconnectDurationLimitOn &&
|
|
1560
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1558
1561
|
this._socket.close();
|
|
1559
1562
|
this.disconnectDurationLimitExceeded = true;
|
|
1560
|
-
return;
|
|
1561
1563
|
}
|
|
1562
1564
|
this._socket.sendBuffer = [];
|
|
1563
1565
|
});
|
|
1564
1566
|
this._socket.io.on("reconnect_attempt", () => {
|
|
1565
1567
|
var _a;
|
|
1566
|
-
if (this._disconnectDurationLimitOn &&
|
|
1568
|
+
if (this._disconnectDurationLimitOn &&
|
|
1569
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1567
1570
|
this._socket.close();
|
|
1568
1571
|
this.disconnectDurationLimitExceeded = true;
|
|
1569
|
-
return;
|
|
1570
1572
|
}
|
|
1571
1573
|
if (this._wasConnectedUsingWebsocket) {
|
|
1572
1574
|
this._socket.io.opts.transports = ["websocket"];
|
|
@@ -1590,25 +1592,30 @@ class ServerSocket {
|
|
|
1590
1592
|
const transport = this.getTransport();
|
|
1591
1593
|
if (transport === "websocket") {
|
|
1592
1594
|
this._wasConnectedUsingWebsocket = true;
|
|
1593
|
-
if (!this.noopKeepaliveInterval)
|
|
1595
|
+
if (!this.noopKeepaliveInterval) {
|
|
1596
|
+
let disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1594
1597
|
this.noopKeepaliveInterval = setInterval(() => {
|
|
1595
1598
|
try {
|
|
1596
1599
|
if (this._socket.connected) {
|
|
1597
|
-
if (this._disconnectDurationLimitOn
|
|
1598
|
-
this.
|
|
1600
|
+
if (this._disconnectDurationLimitOn &&
|
|
1601
|
+
!this._didExceedDisconnectDurationLimit(disconnectDurationLimitTimestampCandidate)) {
|
|
1602
|
+
this._disconnectDurationLimitLatestTimestamp =
|
|
1603
|
+
disconnectDurationLimitTimestampCandidate;
|
|
1604
|
+
disconnectDurationLimitTimestampCandidate = Date.now();
|
|
1599
1605
|
}
|
|
1600
1606
|
this._socket.io.engine.sendPacket("noop");
|
|
1601
1607
|
}
|
|
1602
1608
|
}
|
|
1603
1609
|
catch (ex) { }
|
|
1604
1610
|
}, NOOP_KEEPALIVE_INTERVAL);
|
|
1611
|
+
}
|
|
1605
1612
|
}
|
|
1606
1613
|
});
|
|
1607
1614
|
this._socket.on("disconnect", () => {
|
|
1608
|
-
if (this._disconnectDurationLimitOn &&
|
|
1615
|
+
if (this._disconnectDurationLimitOn &&
|
|
1616
|
+
this._didExceedDisconnectDurationLimit(this._disconnectDurationLimitLatestTimestamp)) {
|
|
1609
1617
|
this._socket.close();
|
|
1610
1618
|
this.disconnectDurationLimitExceeded = true;
|
|
1611
|
-
return;
|
|
1612
1619
|
}
|
|
1613
1620
|
this.joinRoomFinished = false;
|
|
1614
1621
|
this.disconnectTimestamp = Date.now();
|
|
@@ -1618,20 +1625,18 @@ class ServerSocket {
|
|
|
1618
1625
|
}
|
|
1619
1626
|
});
|
|
1620
1627
|
}
|
|
1621
|
-
_didExceedDisconnectDurationLimit() {
|
|
1622
|
-
if (!this._disconnectDurationLimitOn)
|
|
1623
|
-
return false;
|
|
1624
|
-
if (this._disconnectDurationLimitInMs && this._noopKeepaliveTimestamp) {
|
|
1625
|
-
const disconnectedDuration = Date.now() - this._noopKeepaliveTimestamp;
|
|
1626
|
-
if (disconnectedDuration > this._disconnectDurationLimitInMs) {
|
|
1627
|
-
return true;
|
|
1628
|
-
}
|
|
1628
|
+
_didExceedDisconnectDurationLimit(timestamp) {
|
|
1629
|
+
if (!timestamp || !this._disconnectDurationLimitOn || !this._disconnectDurationLimitEnabled)
|
|
1629
1630
|
return false;
|
|
1631
|
+
const disconnectedDuration = Date.now() - timestamp;
|
|
1632
|
+
if (disconnectedDuration > DISCONNECT_DURATION_LIMIT_MS) {
|
|
1633
|
+
return true;
|
|
1630
1634
|
}
|
|
1635
|
+
return false;
|
|
1631
1636
|
}
|
|
1632
|
-
|
|
1637
|
+
enableDisconnectDurationLimit() {
|
|
1633
1638
|
if (this._disconnectDurationLimitOn) {
|
|
1634
|
-
this.
|
|
1639
|
+
this._disconnectDurationLimitEnabled = true;
|
|
1635
1640
|
}
|
|
1636
1641
|
}
|
|
1637
1642
|
setRtcManager(rtcManager) {
|