79240736

Date: 2024-12-01 01:01:59
Score: 0.5
Natty:
Report link

This is the rule for mobile problems like this-- only if you have an actual physical click on the screen, then it will accept that the client really wants to load / playback data via JavaScript. This is by design, to protect developers from wasting mobile data by autoplaying ads etc.

There are various levels you can try to get past this:

  1. Don't make your <audio> render conditionally. Render it right away with a 1-second silent audio file. Obviously, a careful OS will not let you just create and play a new sound object whenever you want. Maybe (maybe!) this will be enough.
  2. Use JavaScript to start playing the audio off of any other button, then immediately pause it again. Once you've done this, you should be able to resume playback at any time later, even if you change the audio source (which you will do later). This "catching a click" technique is very useful to understand and use.

Unfortunately, I can't test code for an Apple product, since I refuse ever to buy one again. But hopefully now you have a better understanding of WHY things mysteriously refuse to play or record on Apple devices.

Also, my understanding was that new Apple OS versions are more generous with media control. Do you have an older product? If so, you might want to see if it's a version issue.

Reasons:
  • RegEx Blacklisted phrase (2.5): Do you have an
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • High reputation (-1):
Posted by: Bennyboy1973