ccrma/webchuck-ide

WebChucK halts when browser session is left/ends

mulshine opened this issue · 1 comments

On my iPhone 14 Pro (and presumably most / all iOS devices), WebChucK seems to halt / pause (or break) when you leave and return to browser. When you return to browser and IDE, it is not possible to add or remove shreds, and the VM time reported stalls. (Switching tabs within single browser session and returning to IDE tab works fine.)

Repeatability steps:

  • Load IDE in iOS web browser (Chrome or Safari)
  • Start WebChucK
  • Add shred (e.g. helloSine.ck)
  • Leave or close browser session
  • Return to browser session (everything is stalled, no sound, also know console log errors)

Possible fix 1: Simply resume audio context? E.g. theChuck.audioContext.resume()... same fix that we've had to do for multiple iOS problems in the past.

Possible fix 2: (less optimal, inflexible) Remove shreds and "Stop WebChucK" when browser session is left/ended. Leave it up to user to start and add shreds back as they please.

Note: this also happens in custom site (e.g. https://mikemulshine.com/accel) so it's possibly a webchuck-wide issue on iOS devices.