F
F
Fenixsar2016-02-29 20:30:12
JavaScript
Fenixsar, 2016-02-29 20:30:12

Why doesn't play more than one file in Chrome Mobile?

Good afternoon.
In js I declare two audio objects.

var sound = new Audio('sounds/button.wav');
var soundError = new Audio('sounds/error.wav');

//Затем после нажатий на разные кнопки пытаюсь воспроизвести

sound.play();
soundError.play();

The problem is: in Chrome Mobile, if you click on one button, everything works, several times, everything is fine. But if you click after the second one, nothing happens. The same is true in reverse, only the first file is played. Both files are short, less than a second.
This code works fine in the desktop version of the Chrome browser in any order.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question