Upload 2 files
Browse files- frontend/js/main.js +4 -1
- frontend/js/video-manager.js +1 -5
frontend/js/main.js
CHANGED
|
@@ -346,9 +346,12 @@ class GeminiApp {
|
|
| 346 |
this.currentResponseElement = null;
|
| 347 |
break;
|
| 348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
case 'interrupted':
|
| 350 |
this.audioManager.flushPlayback();
|
| 351 |
-
this.uiController.showWarning('Interrupted');
|
| 352 |
break;
|
| 353 |
|
| 354 |
case 'reconnection':
|
|
|
|
| 346 |
this.currentResponseElement = null;
|
| 347 |
break;
|
| 348 |
|
| 349 |
+
case 'generation_complete':
|
| 350 |
+
// Silent completion signal from server; no UI action needed
|
| 351 |
+
break;
|
| 352 |
+
|
| 353 |
case 'interrupted':
|
| 354 |
this.audioManager.flushPlayback();
|
|
|
|
| 355 |
break;
|
| 356 |
|
| 357 |
case 'reconnection':
|
frontend/js/video-manager.js
CHANGED
|
@@ -78,21 +78,17 @@ export class VideoManager {
|
|
| 78 |
this.videoStream = await navigator.mediaDevices.getUserMedia(constraints);
|
| 79 |
console.log(`✅ Camera started with facingMode: ${facingMode}`);
|
| 80 |
} catch (firstError) {
|
| 81 |
-
|
| 82 |
-
|
| 83 |
const fallbackMode = facingMode === 'environment' ? 'user' : 'environment';
|
| 84 |
constraints.video.facingMode = fallbackMode;
|
| 85 |
|
| 86 |
try {
|
| 87 |
this.videoStream = await navigator.mediaDevices.getUserMedia(constraints);
|
| 88 |
-
console.log(`✅ Camera started with fallback facingMode: ${fallbackMode}`);
|
| 89 |
this.currentFacingMode = fallbackMode;
|
| 90 |
} catch (secondError) {
|
| 91 |
-
console.warn('Falling back to any available camera');
|
| 92 |
this.videoStream = await navigator.mediaDevices.getUserMedia({
|
| 93 |
video: { width: { ideal: 640 }, height: { ideal: 480 } }
|
| 94 |
});
|
| 95 |
-
console.log('✅ Camera started with default settings');
|
| 96 |
}
|
| 97 |
}
|
| 98 |
} else {
|
|
|
|
| 78 |
this.videoStream = await navigator.mediaDevices.getUserMedia(constraints);
|
| 79 |
console.log(`✅ Camera started with facingMode: ${facingMode}`);
|
| 80 |
} catch (firstError) {
|
| 81 |
+
// Silently fall back — OverconstrainedError is expected on devices without the requested camera
|
|
|
|
| 82 |
const fallbackMode = facingMode === 'environment' ? 'user' : 'environment';
|
| 83 |
constraints.video.facingMode = fallbackMode;
|
| 84 |
|
| 85 |
try {
|
| 86 |
this.videoStream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
|
|
| 87 |
this.currentFacingMode = fallbackMode;
|
| 88 |
} catch (secondError) {
|
|
|
|
| 89 |
this.videoStream = await navigator.mediaDevices.getUserMedia({
|
| 90 |
video: { width: { ideal: 640 }, height: { ideal: 480 } }
|
| 91 |
});
|
|
|
|
| 92 |
}
|
| 93 |
}
|
| 94 |
} else {
|