title: Play (and replay) a sound on safari mobile
body: <p>I need to play a sound when a new message appears on a website. It works fine on Chrome and Safari but I can't make it work on Safari mobile. 
  I saw that the sound has to be initialised with a user action so I tried that:</p>
  
  <pre><code>var sound = new Audio('./path/to/my/sound.mp3');
  var hasPlayed = false;
  
  $('body').bind('click touchstart', function() {
    sound.load();
  });    
  
  sound.addEventListener('play', function() {
    hasPlayed = true;
  });
  
  var playSound = function() {
    if(hasPlayed) {
      sound.currentTime = 0;
    }
    sound.play();
  }
  </code></pre>
  
  <p>Unfortunately, the sound still don't play. I also tried with the <a href="http://buzz.jaysalvat.com/" rel="noreferrer">Buzz</a> library, and the issue is the same.</p>
  
  <p>So, the question is : how can I play a sound programmatically on mobile browsers ?</p>