feat: add Vite configuration with custom plugins and server settings
This commit is contained in:
@@ -41,6 +41,36 @@ const MEMBERSHIP_REFRESH_INTERVAL_MS = 45 * 60 * 1000;
|
||||
/** Call membership expiry time (1 hour) */
|
||||
const MEMBERSHIP_EXPIRY_MS = 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Check WebRTC capabilities and log diagnostic information
|
||||
*/
|
||||
function checkWebRTCSupport(): { supported: boolean; details: Record<string, unknown> } {
|
||||
const details: Record<string, unknown> = {
|
||||
userAgent: navigator.userAgent,
|
||||
platform: navigator.platform,
|
||||
};
|
||||
|
||||
// Check for key WebRTC APIs
|
||||
details.hasGetUserMedia = !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
|
||||
details.hasRTCPeerConnection = !!(window.RTCPeerConnection);
|
||||
details.hasRTCDataChannel = !!(window.RTCPeerConnection && window.RTCPeerConnection.prototype.createDataChannel);
|
||||
|
||||
// Check WebKit-specific APIs
|
||||
details.hasWebkitGetUserMedia = !!(navigator.getUserMedia || (navigator as any).webkitGetUserMedia);
|
||||
details.hasWebkitRTCPeerConnection = !!((window as any).webkitRTCPeerConnection);
|
||||
|
||||
// Check if mediaDevices API exists
|
||||
details.hasMediaDevices = !!navigator.mediaDevices;
|
||||
details.hasEnumerateDevices = !!(navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);
|
||||
|
||||
const supported = !!(
|
||||
(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) &&
|
||||
(window.RTCPeerConnection || (window as any).webkitRTCPeerConnection)
|
||||
);
|
||||
|
||||
return { supported, details };
|
||||
}
|
||||
|
||||
/**
|
||||
* Service for managing Matrix RTC calls via LiveKit
|
||||
* Handles LiveKit connections, media streams, call state, and Matrix room signaling
|
||||
@@ -283,6 +313,15 @@ export class CallService {
|
||||
console.log('Got LiveKit JWT, connecting to:', this.livekitJwt.url);
|
||||
console.log('LiveKit JWT response:', JSON.stringify(this.livekitJwt));
|
||||
|
||||
// Check WebRTC support before attempting connection
|
||||
const webrtcCheck = checkWebRTCSupport();
|
||||
console.log('WebRTC support check:', webrtcCheck);
|
||||
|
||||
if (!webrtcCheck.supported) {
|
||||
console.warn('WebRTC may not be fully supported. Attempting connection anyway...');
|
||||
console.warn('WebRTC details:', JSON.stringify(webrtcCheck.details, null, 2));
|
||||
}
|
||||
|
||||
// Step 3: Create and connect to LiveKit room
|
||||
this.livekitRoom = new Room({
|
||||
adaptiveStream: true,
|
||||
|
||||
Reference in New Issue
Block a user