Online straming application: Uncaught (in promise) DOMException

Online straming application: Uncaught (in promise) DOMException

On urbansunsets.com, I have implemented radio streaming in HTML5 and JavaScipt (jQuery). There is an error on iPhones.

The code:

HTML
  1. <div class="col-lg-12 col-sm-12">
  2. <div id="radio_player">
  3. <div class="default-player">
  4.  <audio width="320" height="240" controls playsinline id="audio_player">
  5. <source id="player_source" src="http://public.radio.co/stations/sedf8bacc9/m3u" type="audio/mpeg">
  6. </audio>
  7. </div>

  8. <div id="audioplayer">
  9. <button id="pButton" class="pause"></button>
  10. <div class="live">Livee</div>
  11. <div id="volume_control">
  12. <label id="rngVolume_label" for="rngVolume">
  13. <i class="fa fa-volume-up" aria-hidden="true"></i>
  14. </label>
  15. <input type="range" id="rngVolume" min="0" max="1" step="0.01" value="0.5">
  16. </div>
  17. <div class="current-piece">
  18. <div class="now-playing">Now playing:</div>
  19. <div id="song_name">
  20. <script src="https://public.radio.co/embed/sedf8bacc9/song.js"></script>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>

jQuery:

  1. (function() {
  2. setTimeout(function(){
  3. document.getElementById("audio_player").play();
  4. }, 300);

  5. var music = document.getElementById('audio_player');

  6. function playAudio() {
  7. if (music.paused) {
  8. music.play();
  9. pButton.className = "";
  10. pButton.className = "pause";
  11. } else {
  12. music.pause();
  13. pButton.className = "";
  14. pButton.className = "play";
  15. }
  16. }

  17. $('#pButton').on('click', playAudio);

  18. $(function() {
  19. var timeout
  20. $("audio").on({
  21. pause: function() {
  22. clearTimeout(timeout)
  23. },
  24. play: monitor
  25. })
  26. $("#rngVolume").on("input",function(){
  27. $("audio").prop("volume",this.value)
  28. })
  29. });

  30. function monitor() {
  31. $("#rngVolume").val($("audio").prop("volume"))
  32. $.ajax("https://public.radio.co/stations/sedf8bacc9/status", {
  33. cache: false
  34. }).then(function(data) {
  35. $(".title").text(data.current_track.title)
  36. $(".data").text(JSON.stringify(data, 4, 4))
  37. $(".artwork").attr("src", data.current_track.artwork_url)
  38. timeout = setTimeout(monitor, 1000 * 60)
  39. })
  40. }
  41. })();
The error: 

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

I have only seam it on iPhones.

What is the cause of this error?