iOS Safari audio cuts off when new audio is loaded

  • I am working on a music player web app. On android and desktop platforms, the autoplay feature (skip to next song or play a related song) works just fine. On iOS, when a new audio file is loaded into the html audio element, the audio being played by safari (or any other browser) is cut off and the OS integrated media player displays "Not playing". The skip function simply sets the audio src attribute to a new url audio.src = url;, loads audio.load(); and plays the song audio.play();. Are there any browser settings I can change or workarounds I can implement in the front end javascript?

    Quote
  • from like 2 minutes of googling, im gonna guess its something to do with this. the pwa runs under the execution of a browser or web platform and apple has 2 media players, an application player for local playing (only inside the app) and a system player for running music through the music app which plays it globally I think, so browsers most likely use the application player for audio and you cant change that. Again i dont know your exact issue and havent work on apple software so its possible that im 100% wrong but yeah

  •   Tozzit That's unfortunate. I guess the only approach to this problem would be to make a simple web wrapper that would display my music player as a native iOS app (using the global media player). Haven't really dug into apple development so that would be a hassle to pull off. Thanks for the info tho

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!