jaysalvat / buzz

Buzz is a small but powerful Javascript library that allows you to easily take advantage of the new HTML5 audio element. It tries to degrade silently on non-modern browsers.
http://buzz.jaysalvat.com
MIT License
1.21k stars 227 forks source link

Workaround mobile browsers? #100

Closed thomasduenser closed 8 years ago

thomasduenser commented 8 years ago

Hello,

first of all - buzz is awesome! Thanks for the great work!

I'm aware of the fact, that we need a user interaction on mobile browsers to play the sounds as stated in your documentation. Is there a hack / workaround to make it still possible?

My scenario: User Interaction -> load sound via SoundCloud API -> set up buzz object and play. This does not work mobile although this all happens when the user clicks on a specific element. I think that the problem is that I'm loading the sound with the SoundCloud API.

Can I fake a user interaction?

Thanks in advance for the help! Thomas

jaysalvat commented 8 years ago

Hello :)

As far as I know, unfortunately, no.

thomasduenser commented 8 years ago

Thank you for the fast response. It seems to be my mistake, right? Your demo page is working on mobile browsers. Do I understand it correct -> for each sound I want to play, I need a user interaction. This means, there's no possibility to play 5 different songs one after another automatically after the first user interaction?

EDIT: I need to load the sound and just have the .play() method in the function (onClick for example). Ok, that could be hard because I stream the sounds. I think this issue can be closed because it's no issue related to buzz. If you have some tips for me, they are welcome. :)

jaysalvat commented 8 years ago

Yes you need user interaction. As far as I know, you can't play 5 different songs one after another automatically. No autoplay or even preload are allowed.

Regards.