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

Stop playback #2

Closed
hawkerboy7 opened this issue Nov 18, 2013 · 6 comments
Closed

Stop playback #2

hawkerboy7 opened this issue Nov 18, 2013 · 6 comments
Assignees
Labels

Comments

@hawkerboy7
Copy link

Hi,

It would be nice if you can stop the playback.

I added:
var stopSound = function (name) {
var $sound = sounds[name];
$sound.pause();
$sound.currentTime = 0;
};

and

$.ionSound.stop = function (name) {
stopSound(name);
};

This seems to work however I don't know if it stays in memory of the browser like this and takes unnecessary memory, you probably know better... :)

It would also be nice to add the stop fade-out-over-time (linear, ease, etc...)

@IonDen
Copy link
Owner

IonDen commented Nov 19, 2013

Hi, the design of ion.sound was to avoid situation, there you will need stop method. But, i think it will be good to have one for some rare reasons. So, in future release i will add it.

@ghost ghost assigned IonDen Nov 19, 2013
@hawkerboy7
Copy link
Author

Yes I saw in the code that you don't require a stop when another instance of your sound starts, which is nice!
But for example when you make a sound that should only play on a mouse-over, you can't stop it when the mouse-over is finished :) That's why I needed it, and also made it.

Do you want me to make a branch with the adjustments?

@IonDen
Copy link
Owner

IonDen commented Nov 19, 2013

That is the plugin design. It is designed to only trigger sound playback. Not playing sounds with controls (you should agree that small sounds like "beep" are so short, that there is no need to stop them). So the stop method will be the last contol method for this plugin 😄 Or some time later people will ask for rewind methods 😩
Tnx for your help, no need for branch.

@hawkerboy7
Copy link
Author

Yes I agree!
Haha, you're welcome!
Thank you for your nice plugin;)

@IonDen
Copy link
Owner

IonDen commented Nov 30, 2013

Added in 1.3.0

@IonDen IonDen closed this as completed Nov 30, 2013
@hawkerboy7
Copy link
Author

Great thank you! :D

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

No branches or pull requests

2 participants