udit
udit

Reputation: 2783

Howler JS audio plays on desktop but doesnt play on mobile device (iOS Firefox and Safari)

I have a simple HTML/JS file with a button click handler playing an mp3 file via Howler JS. The audio works on desktop (Firefox) but doesnt work on iOS Firefox/Safari. Any clues why?

    var sound = new Howl({
            src: ['zap.mp3'],
            preload: true
          });
          window.onload = function(){
            var playButton = document.getElementById('play-button');
            playButton.addEventListener('click', function() {
              sound.play();
            })
          }

For ease of debugging, I deployed a basic html file here. Doing "view source" on it should work, it's pretty basic.

Upvotes: 0

Views: 2290

Answers (1)

udit
udit

Reputation: 2783

Found the answer, it was in silent mode. Some howler js audio doesnt play in Silent mode and thats a known issue: https://github.com/goldfire/howler.js/issues/1436

Upvotes: 1

Related Questions