0

I have a site that every time the javascript executes document.getElementById('audioID').load(); or document.getElementById('audioID').play(); it will cause my iPad/ iPod running iOS8 in standalone mode to suddenly crash and exit to the home screen. The same site running the normal Safari browser on iOS8 works perfectly fine. I could not reproduce this issue on iOS7 either.

This issue seems similar to the following stack issue that appears to be describing an IOS8 bug: Why HTML5 video doesn't play in IOS 8 WebApp(webview)? , except that my issue deals with audio instead of video and is not just failing to play the audio but it is crashing the standalone window.

Has anyone else experienced this, or know what exactly could be causing the standalone mode to crash after?

[UPDATE]

It appears to be the combination of a submit button along with attempting to play audio in iOS8's standalone mode will cause a crash. I have created a quick gist that demos this bug here: https://gist.github.com/macmadill/262d65ad1c02936fca4b

[UPDATE]

I retested this bug on 3 different iPads, here are my results:

iOS 8.1.2 - standalone mode crashed

iOS 8.3 - no issue

iOS 9.2.1 - no issue

Community
  • 1
  • 1
Mac
  • 1,025
  • 3
  • 12
  • 22
  • For a temporary fix I have disabled audio for iOS8's standalone mode by adding the following line BEFORE I execute an audio `.load()` or `.play()`. `if((navigator.appVersion).match('OS 8_') && window.navigator.standalone){return false;}` – Mac Jan 20 '15 at 18:39

2 Answers2

-1

I ran across the same issue. For a slightly complex workaround, it turns out that using the Web Audio API worked even when the "webapp" was saved to the ios home screen. See the following:

Some of the examples use a deprecated API. For example:

  • noteOn(x) is now start(x).
  • createGainNode() is now createGain()
mtkopone
  • 5,955
  • 2
  • 27
  • 30
-1

The only solution is to use the Web Audio API.

I found out that https://github.com/goldfire/howler.js/ is a great wrapper that make it easy to use.

Good luck

Guy S
  • 622
  • 6
  • 13