问题
I'm making a little browser game as a study project, with howler.js 2.0 handling the sound effects.
When I play the game on iOS and I'm listening to music (say, in the music player app), the game sound effects will stop the background audio. Actually, I believe all background audio stops upon load of the game.
Is there any way to prevent this and keep the background audio going?
I'd prefer to avoid audio ducking as well, but could live with that if it's the only option.
The game is here: http://ashryanbeats.com/apps/guessing-game/index.html
Howler is invoked in this way:
var sound = new Howl({
src: ['sounds/game-sounds.ogg', 'sounds/game-sounds.mp3'],
sprite: {
warmSound: [0, 750],
coldSound: [875, 950],
winSound: [1930, 2500],
sameSound: [4518, 850],
loseSound: [6093, 1700]
}
});
howler.js 2.0 ref: https://github.com/goldfire/howler.js/tree/2.0
来源:https://stackoverflow.com/questions/27983463/avoid-stopping-background-audio-for-howler-js-sprite-playback-on-ios