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

Repeats beginning of audio file in iOS #5

Open
pseudojk opened this issue Dec 13, 2013 · 5 comments
Open

Repeats beginning of audio file in iOS #5

pseudojk opened this issue Dec 13, 2013 · 5 comments

Comments

@pseudojk
Copy link

I'm using this as a kind of piano playing mobile site with each note assigned in the sprite, but in iOS it will randomly play the very first one instead of it's intended note. When the note is repeatedly pressed it will eventually play the correct one, but this happens on every note and seems to happen randomly.

Has anyone else had this problem?

I've found a workaround that uses individual files for each note instead of sections of a larger file. This isn't ideal though because each note has to load on click now. Is there a way to silently preload/preplay the sounds without user interaction?

Update: I reverted back to using one audio file that has all the notes in it - except I used "mbAudio.pause()" instead of "mbAudio.stop()" and that solved the repeating problem. I guess stop makes the "playhead" move back to zero and that was causing the repeat.

@karneaud
Copy link

bump! I'm trying to do something pretty similar and co-incidentally experiencing the exact same problem...how did you "pause()" it?

@pseudojk
Copy link
Author

I used the sprite method and "mbAudio.pause()" on onMouseUp / touchEnd events. Example:

 <div id="soundButton" ontouchstart="$.mbAudio.play('soundSprite', 'sound1');" ontouchend="$.mbAudio.pause('soundSprite', 'sound1');"></div>

@karneaud
Copy link

Wow...well that sucks for me!

@pseudojk
Copy link
Author

Hmm. Not working for you? I did that a year ago, a lot's changed about iOS since then. iOS/Safari was(is?) notoriously weird about playing sounds in-browser, latency issues, etc.

@karneaud
Copy link

Nope. I'm however trying to pause it in the play function

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