geedback

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit cfeb1a7bcacf8bd2ed0407adf558239c8906e781
parent 8cfa34a06a98fe3b3c2f2dbd1297bf42d25009da
Author: minerva-jupiter <ryouturn@gmail.com>
Date:   Sat, 23 May 2026 21:27:32 +0900

Merge branch 'main' of https://github.com/minerva-jupiter/geedback

Diffstat:
Msrc/main.ts | 23++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/main.ts b/src/main.ts @@ -171,6 +171,20 @@ const setupKaossPad = () => { }; const startSynth = async () => { + // 1. Request Sensor Permissions (iOS 13+) - MUST be first to keep user gesture context + try { + if (typeof (DeviceMotionEvent as any).requestPermission === "function") { + await (DeviceMotionEvent as any).requestPermission(); + } + if ( + typeof (DeviceOrientationEvent as any).requestPermission === "function" + ) { + await (DeviceOrientationEvent as any).requestPermission(); + } + } catch (e) { + console.error("Sensor Permission Error:", e); + } + if (!wasmInitialized) { try { await init(); @@ -197,15 +211,6 @@ const startSynth = async () => { scriptNode.connect(audioCtx.destination); if (audioCtx.state === "suspended") await audioCtx.resume(); - // Sensor Permissions (iOS) - if (typeof (DeviceMotionEvent as any).requestPermission === "function") { - try { - await (DeviceMotionEvent as any).requestPermission(); - } catch (e) { - console.error("Permission denied", e); - } - } - isActive = true; if (startBtn) { startBtn.textContent = "Stop Audio & Sensors";