Skip to content

Commit 7e2a03e

Browse files
Attempt ViaAnthroposBenevolentia#3 to fix Permission Denied in mobile when turning on the mic
1 parent 2e2a522 commit 7e2a03e

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Gemini 2.0 Flash Multimodal Live API Client</title>
7-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
7+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
88
<link rel="stylesheet" href="css/style.css">
99
</head>
1010
<body>
@@ -21,7 +21,7 @@
2121
<input type="text" id="message-input" placeholder="Enter message...">
2222
<button id="send-button">Send</button>
2323
<button id="mic-button">
24-
<span id="mic-icon" class="material-symbols-outlined">mic</span>
24+
<span id="mic-icon" class="material-icons">mic</span>
2525
</button>
2626
<button id="camera-button">
2727
<span id="camera-icon" class="material-symbols-outlined">videocam</span>

js/main.js

+28-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,19 @@ messageInput.addEventListener('keypress', (event) => {
328328
}
329329
});
330330

331-
micButton.addEventListener('click', handleMicToggle);
331+
// Remove all existing mic button event listeners
332+
micButton.removeEventListener('click', handleMicToggle);
333+
micButton.onclick = null;
334+
335+
// Add a single, simple click handler
336+
micButton.addEventListener('click', () => {
337+
console.log('Mic button clicked'); // Debug log
338+
if (!isConnected) {
339+
logMessage('Please connect first', 'system');
340+
return;
341+
}
342+
handleMicToggle();
343+
});
332344

333345
connectButton.addEventListener('click', () => {
334346
if (isConnected) {
@@ -635,3 +647,18 @@ function checkAudioSupport() {
635647
}
636648
return true;
637649
}
650+
651+
if (!micButton) {
652+
console.error('Mic button not found in DOM');
653+
} else {
654+
Logger.info('Mic button found and initialized');
655+
}
656+
657+
micButton.onclick = () => {
658+
console.log('Mic button clicked (direct onclick)');
659+
};
660+
661+
if (micButton) {
662+
micButton.disabled = true; // Start disabled
663+
console.log('Mic button initialized and disabled');
664+
}

0 commit comments

Comments
 (0)