Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio pause trigger onStop function #868

Closed
AnderbergE opened this issue Jun 2, 2014 · 4 comments
Closed

Audio pause trigger onStop function #868

AnderbergE opened this issue Jun 2, 2014 · 4 comments

Comments

@AnderbergE
Copy link

When you use Phaser.Sound.pause() the onStop functions trigger. After that the onPause triggers as well.
This might be by design, but for me it feels like a strange behaviour. I suggest only running the onPause functions when you pause. If that makes the implementation complicated, perhaps the "paused" property can be set to true before the onStop is called, making it possible to distinguish between a call to pause or stop.

photonstorm added a commit that referenced this issue Jun 5, 2014
…values are set before the onPause signal is dispatched (thanks @AnderbergE, fix #868)
@photonstorm
Copy link
Collaborator

Agreed, this should sort it.

@AnderbergE
Copy link
Author

This fix creates another problem:
The sound does not stop playing upon pause, instead it keeps going. When resuming it, it resumes from the pause position, but now two sounds are playing (but sound manager only says that one is).

photonstorm added a commit that referenced this issue Jun 5, 2014
@photonstorm
Copy link
Collaborator

There, that should sort it now. It was resetting isPlayed too early. But on further inspection pause doesn't need to set it at all, as it's set in stop.

@AnderbergE
Copy link
Author

Works for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants