2

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.

Community
  • 1
  • 1
AKFourSeven
  • 1,305
  • 3
  • 18
  • 31
  • 1
    possible duplicate of [Autoplay audio files on an iPad with HTML5](http://stackoverflow.com/questions/3009888/autoplay-audio-files-on-an-ipad-with-html5) –  Jul 24 '13 at 09:41
  • @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: http://jsfiddle.net/xHzAf/15/ – AKFourSeven Jul 24 '13 at 12:40
  • @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 Jul 24 '13 at 12:47
  • 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. –  Jul 24 '13 at 13:39

1 Answers1

4

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.