import Constants from 'expo-constants';
export interface IRTCConfig {
iceServers: RTCIceServer[];
maxRetryAttempts: number;
retryDelayMs: number;
maxIceCandidateQueueSize: number;
connectionTimeout: number;
signaling: {
serverUrl: string;
reconnectDelay: number;
heartbeatInterval: number;
};
media: {
audio: MediaTrackConstraints;
video: MediaTrackConstraints;
};
}
export const RTC_CONFIG: IRTCConfig = {
iceServers: [{ urls: "stun:stun.l.google.com:19302" }],
maxRetryAttempts: 3,
retryDelayMs: 2000,
maxIceCandidateQueueSize: 100,
connectionTimeout: 30000,
signaling: {
serverUrl: `${Constants.expoConfig?.extra?.apiBaseUrl}/ws` || "http://localhost:8080/ws",
reconnectDelay: 3000,
heartbeatInterval: 30000,
},
media: {
audio: { echoCancellation: true, noiseSuppression: true },
video: { width: 1280, height: 720, frameRate: 30 },
},
} as const;