Fix audio on shared play page - add iOS audio unlock
Shared links weren't playing audio on iOS because unlockAudio() wasn't being called 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { MIDIService } from './services/MIDIService';
|
import { MIDIService } from './services/MIDIService';
|
||||||
import { MIDIParser } from './midi/MIDIParser';
|
import { MIDIParser } from './midi/MIDIParser';
|
||||||
import { MotifEngine } from './core/MotifEngine';
|
import { MotifEngine } from './core/MotifEngine';
|
||||||
|
import { unlockAudio } from './utils/audioUnlock';
|
||||||
import type { NoteEvent } from './types';
|
import type { NoteEvent } from './types';
|
||||||
|
|
||||||
function qs(id: string): HTMLElement {
|
function qs(id: string): HTMLElement {
|
||||||
@@ -279,6 +280,9 @@ async function main(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Unlock audio for iOS - must be called from user gesture
|
||||||
|
await unlockAudio();
|
||||||
|
|
||||||
// First play generates the artifact (deterministically from MIDI structure).
|
// First play generates the artifact (deterministically from MIDI structure).
|
||||||
if (!isGenerated) {
|
if (!isGenerated) {
|
||||||
// Match main page "Generate & Play": procedural role-mapping → existing SynthesisEngine.
|
// Match main page "Generate & Play": procedural role-mapping → existing SynthesisEngine.
|
||||||
|
|||||||
Reference in New Issue
Block a user