Audio and Video autoplay bug on iOS | XM Community
Skip to main content

I’m designing a survey (testlink) for kindergartners (4-7yo). It has autoplayed audio instructions either from .mp3 or .mp4 (video) files embedded as html. I also set up autoadvance on all pages, either  triggered by an action from the kid, or if no action is required (e.g. they watch a short video clip), after a set number of seconds. The survey works perfectly on all platforms and browsers I tried, EXCEPT on iOS (iPhone, iPad), where files do not autoplay if they are preceded by a time-based autoadvance. Comments, suggestions are much appreciated.

More info:

  • It does not appear to matter whether autoadvance is triggered by a Timing-type question, or if by a Javascript (setTimeout jQuery).
  • If I hit the next button manually before the autoadvance goes off, the autoplay works as intended.
  • I tried multiple browsers on the iPad (Firefox, Chrome, and Safari) and the bug is consistent across all.
  • My .mp3 and .mp4 files are on Dropbox. I tried moving an .mp3 to Qualtrics library, but that doesn’t make a difference.
  • This suggestion to play video onReady seems promising, but I failed to find sample JavaScript for this. (although there is this monster, which may work if I moved my video to YouTube, but I am too scared to do that just yet).

Sample audio html:
```

<audio autoplay="autoplay"><source src="https://www.dropbox.com/scl/fi/XXXXXXXXXX/SAMPLE.mp3?rlkey=XXXXXXXXXX&st=XXXXXXXXXX&raw=1" /></audio>

```

 

Sample video html:

```

<video  autoplay="autoplay" height="480" width="640">

<source src="https://www.dropbox.com/scl/fi/XXXXXXXXXX/SAMPLE.m4v?rlkey=XXXXXXXXXX&st=XXXXXXXXXX&raw=1" type="video/mp4"></video>

```

 

 

Answering my own question here: after a day of desperate attempts, it seems that the problem is not as consistent as it seemed. Sometimes the audios and videos do play on the bloody iPad. Switching to different html codes, delaying start etc do not seem to help.

My best guess at the moment is that the issue is caused by some Apple “security” feature preventing audio autoplay if it’s not preceded by some click action, as described here. In short, I’m looking at options to add superfluous click actions in the survey (and finding non iOS devices to use).


Autoplay is disabled on ALL platforms by default. If you want autoplay to work consistently, you need the user to play something in your survey before the autoplay question. So, suppose you want to autoplay something in Q11, ask them to click on the play icon of a video/audio in Q9 or before that.

The browser keeps a record of the various interactions that a user has had on the page and unless the user has explicitly played something, the browswer will not allow autoplay to work. Even the playing that is triggered by JS.

 

Hope this helps.


Leave a Reply