pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
295 stars 34 forks source link

Audio repeats in 1-2 second loop when chrome back button is pressed and "are you sure you want to leave changes you made might not be saved" notification shows #115

Closed Two119 closed 10 months ago

Two119 commented 10 months ago

I was working on a web port for my game when I noticed the audio loops in 1-2 second loop of whatever sound it was currently playing when you press chrome back button and "are you sure you want to leave changes you made might not be saved" notification shows up.

pmp-p commented 10 months ago

i think default dialog should always call music.pause() in pygame patched functions before sending the dialog and resume them if the "kill" is aborted. If kill is not aborted no problem since it would already be paused.

pmp-p commented 10 months ago

note that the fix can only deal with mixer.music . Maybe SDL2 sfx can cause trouble. feel tree to reopen after 0.8 in that case