title: Allow audio.play() on safari for chat app
body: <p>Since Apple disabled the ability to autoplay audio via <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play" rel="nofollow noreferrer"><code>HTMLMedia​Element​.play()
  </code></a> in javascript without user interaction, I am not sure how I should play a sound when a user gets a chat message before interacting with the DOM after the page loads.</p>
  
  <pre class="lang-js prettyprint-override"><code>socket.on("receive message", data =&gt; {
    const receiveSound = new Audio("1.mp3");
    messages.push(data);
    receiveSound.play();
  });
  </code></pre>
  
  <p>I tried playing the audio element on a <code>mousemove</code> event. I also tried to fake a <code>click()</code> through an element on a React ref to initially activate it. Neither solutions worked.</p>
  
  <p>Is there a way to autoplay an audio element if there is a message coming in? It must be possible since YouTube can autoplay videos without interaction.</p>
  
  <p>Every time I try to play the audio, I get this error:</p>
  
  <pre><code>Unhandled Rejection (NotAllowedError): The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
  </code></pre>