Skip to content

Commit

Permalink
Merge pull request #2294 from robintown/timeout-experiment
Browse files Browse the repository at this point in the history
Experiment with different timeouts
  • Loading branch information
robintown authored Apr 15, 2024
2 parents 1381640 + 51cc406 commit fc4ced7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/livekit/useECConnectionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ import * as Sentry from "@sentry/react";

import { SFUConfig, sfuConfigEquals } from "./openIDSFU";

declare global {
interface Window {
peerConnectionTimeout?: number;
websocketTimeout?: number;
}
}

/*
* Additional values for states that a call can be in, beyond what livekit
* provides in ConnectionState. Also reconnects the call if the SFU Config
Expand Down Expand Up @@ -124,7 +131,12 @@ async function connectAndPublish(
micTrack: LocalTrack | undefined,
screenshareTracks: MediaStreamTrack[],
): Promise<void> {
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt);
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt, {
// Due to stability issues on Firefox we are testing the effect of different
// timeouts, and allow these values to be set through the console
peerConnectionTimeout: window.peerConnectionTimeout ?? 45000,
websocketTimeout: window.websocketTimeout ?? 45000,
});

if (micTrack) {
logger.info(`Publishing precreated mic track`);
Expand Down

0 comments on commit fc4ced7

Please sign in to comment.