2
votes

I have read that autoplay was not possible, or not advised on both iOS and Android (more on that here: no autoplay in iframe HTML5 player on mobile (Android Chrome and Firefox)?). But I was wondering if there was a way that would allow to replicate the same behavior, that is the video playing soon as the page is loaded.

I have tried preloading the video, and playing it once the DOM is loaded, I tried forcing a play soon as the video can be played, none of that work, it always result in the user having to tap the video to play it.

Can anyone help?

NB: I'm working with plain old JavaScript, no jQuery.

1
possible duplicate of Autoplay audio files on an iPad with HTML5user663031
@torazaburo: I do not think it is a duplicate, as I require à 100% Javascript solution that would work on iOS 4.X and above and Androids, but still I will explore this solution... ianace: yes here: jsfiddle.net/xHzAf/15AKFourSeven
@torazaburo: tried the solution from the post you have suggested, it was a hack that has since then been corrected, it does not work anymore, nor does it work on current version of Android, but thanks for the effort!!AKFourSeven
I was not proposing you use that hack. That thread clearly indicates it stopped working a long time ago. I cited that merely as background/supplementary information. By the way, I suspect iOS and Android (which I know nothing about) are completely different animals as regards this problem.user663031

1 Answers

4
votes

No, there is no way on iOS/Safari (or iBooks). Videos load only in the context of an event handler reacting to user action such as a touch. You're out of luck.

This has been documented extensively in any number of questions right here on SO, and is clearly documented by Apple.