Closed owen26 closed 9 years ago
is there anyone who can reply on this ?
If it's a restriction by browser, I don't think cocos2d-js can solve it. I guess you will have to live with the fact that music will only play after user clicks atleast once. Shouldn't be a big problem for most games.
As @jarsj said, the game engine runs on the JS environment of browser, so the browser have total control, not inversely. There are some restrictions we can not over pass. We indeed try with web audio API, but the behavior still varies on different browsers.
Thank you guys for the detailed reply. Actually that's exactly what I'm looking for. As the documentation of cocos2d-js does not mention the audio limitation at all, which I think is a crucial part on HTML5 based game development.
Now I can sit tight and investigate my own work-around.
mobile web browsers seems to have video/audio play restriction where the media file load have to be triggered by a user interaction event such as a "click".
how cocos2d-js suppose to solve this?
I've tested it with the Parkour game tutorial code. It indeed not playing on mobile.