zynga/jukebox — pull request #6 by tonistiigi (2012-04-12 15:45:42+00:00)
Title: Pause audio in iOS on screen timeout.

Pauses audio playback in iOS when:

- screen is timed out(auto-lock)
- safari is put on background
- switching between safari tabs

Audio playback is resumed when page becomes active again.

When you pinch to zoom there is still a case where audio keeps on playing but can't be controlled because the timers do not fire. I tried pausing playback between gesturestart and gestureend event but couldn't get it 100% fail-safe. This should not be a big issue as this kind of control is more needed in games where you probably turn off page zooming.