livekit-client 2.15.10 → 2.15.12
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/livekit-client.esm.mjs +129 -23
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +7 -3
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/api/utils.d.ts +1 -0
- package/dist/src/api/utils.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts +1 -0
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +2 -0
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/rpc.d.ts +6 -1
- package/dist/src/room/rpc.d.ts.map +1 -1
- package/dist/ts4.2/api/SignalClient.d.ts +7 -3
- package/dist/ts4.2/api/utils.d.ts +1 -0
- package/dist/ts4.2/room/PCTransportManager.d.ts +1 -0
- package/dist/ts4.2/room/RTCEngine.d.ts +2 -0
- package/dist/ts4.2/room/rpc.d.ts +6 -1
- package/package.json +2 -2
- package/src/api/SignalClient.ts +42 -25
- package/src/api/utils.ts +18 -0
- package/src/room/PCTransportManager.ts +10 -0
- package/src/room/RTCEngine.ts +17 -2
- package/src/room/Room.ts +34 -0
- package/src/room/participant/LocalParticipant.ts +3 -7
- package/src/room/rpc.ts +6 -1
|
@@ -1774,6 +1774,7 @@ export default class LocalParticipant extends Participant {
|
|
|
1774
1774
|
responseTimeout = 15000,
|
|
1775
1775
|
}: PerformRpcParams): Promise<string> {
|
|
1776
1776
|
const maxRoundTripLatency = 7000;
|
|
1777
|
+
const minEffectiveTimeout = maxRoundTripLatency + 1000;
|
|
1777
1778
|
|
|
1778
1779
|
return new Promise(async (resolve, reject) => {
|
|
1779
1780
|
if (byteLength(payload) > MAX_PAYLOAD_BYTES) {
|
|
@@ -1789,14 +1790,9 @@ export default class LocalParticipant extends Participant {
|
|
|
1789
1790
|
return;
|
|
1790
1791
|
}
|
|
1791
1792
|
|
|
1793
|
+
const effectiveTimeout = Math.max(responseTimeout, minEffectiveTimeout);
|
|
1792
1794
|
const id = crypto.randomUUID();
|
|
1793
|
-
await this.publishRpcRequest(
|
|
1794
|
-
destinationIdentity,
|
|
1795
|
-
id,
|
|
1796
|
-
method,
|
|
1797
|
-
payload,
|
|
1798
|
-
responseTimeout - maxRoundTripLatency,
|
|
1799
|
-
);
|
|
1795
|
+
await this.publishRpcRequest(destinationIdentity, id, method, payload, effectiveTimeout);
|
|
1800
1796
|
|
|
1801
1797
|
const ackTimeoutId = setTimeout(() => {
|
|
1802
1798
|
this.pendingAcks.delete(id);
|
package/src/room/rpc.ts
CHANGED
|
@@ -11,7 +11,12 @@ export interface PerformRpcParams {
|
|
|
11
11
|
method: string;
|
|
12
12
|
/** The method payload */
|
|
13
13
|
payload: string;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Timeout for receiving a response after the initial connection (milliseconds).
|
|
16
|
+
* If a value less than 8000ms is provided, it will be automatically clamped to 8000ms
|
|
17
|
+
* to ensure sufficient time for round-trip latency buffering.
|
|
18
|
+
* Default: 15000ms.
|
|
19
|
+
*/
|
|
15
20
|
responseTimeout?: number;
|
|
16
21
|
}
|
|
17
22
|
|