Skip to content

Commit 5a9b5bd

Browse files
committed
fix(showcase): allow microphone in demo iframe so voice demos work
The shell embeds each demo in a cross-origin iframe whose `allow` attribute only granted clipboard access. Browsers block `getUserMedia({ audio: true })` at the Permissions Policy layer in cross-origin frames unless the parent grants `microphone` via `allow`, so every voice demo across every integration threw "Microphone permission denied" before any user prompt was shown. Add `microphone` to the iframe `allow` in all three places that embed demo previews — the per-demo viewer, the standalone preview route, and the demo drawer — so voice demos work uniformly across all 18 integrations. No other demo type uses getUserMedia / getDisplayMedia / geolocation, so no other Permissions Policy features are needed.
1 parent bbf1cf3 commit 5a9b5bd

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

showcase/shell/src/app/integrations/[slug]/[demo]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default function DemoViewerPage() {
115115
src={iframeSrc}
116116
className="h-full w-full border-0 rounded-xl"
117117
title={`${demo.name} demo`}
118-
allow="clipboard-read; clipboard-write"
118+
allow="clipboard-read; clipboard-write; microphone"
119119
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
120120
/>
121121
) : (

showcase/shell/src/app/integrations/[slug]/[demo]/preview/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function StandalonePreviewPage() {
7070
src={src}
7171
className="h-full w-full border-0"
7272
title={`${integration.name}${demo.name}`}
73-
allow="clipboard-read; clipboard-write"
73+
allow="clipboard-read; clipboard-write; microphone"
7474
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
7575
/>
7676
</div>

showcase/shell/src/components/demo-drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function DemoDrawer({
203203
src={iframeSrc}
204204
className="h-full w-full border-0"
205205
title={`${demoName} demo`}
206-
allow="clipboard-read; clipboard-write"
206+
allow="clipboard-read; clipboard-write; microphone"
207207
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
208208
/>
209209
)}

0 commit comments

Comments
 (0)