HTML5 Video autoplay Not working on iPhone and Android?

I created a HTML5 video stream preview site but it doesn't work on iPhone and Android 4+. Can someone please let me know how I can get it to work?

+3


source to share


1 answer


Starting with iOS 6.1, it is no longer possible to automatically play videos on iPad.

My guess as to why they turned off the autoplay feature?

Well, like many device owners have data / bandwidth restrictions on their devices, I think Apple thinks it is up to the user to decide when they start using bandwidth.

After a bit of research, I found the following excerpt from Apple documentation regarding autoplay on iOS devices to confirm my assumption:

"Apple has made the decision to disable automatic video playback on iOS devices through both script and attribute implementation.

In Safari on iOS (for all devices including iPad), where the user can be on the cellular network and charge per block of data, preloading and autoplay are disabled. No data is loaded until the user initiates it. "- Apple Documentation. Below is a separate warning on the Safari HTML5 Help page about why embedded media cannot play in Safari on iOS:

Warning. To prevent unwanted downloads over cellular networks at the expense of users, embedded media cannot be played automatically in Safari on iOS - the user always starts playback. The controller is automatically provided on the iPhone or iPod touch after playback starts, but for the iPad, you must either set the control attribute or provide the controller using JavaScript. This means (from a code point of view) that the Javascript play () and load () methods are inactive until the user starts playing, unless the play () or load () method is triggered by a user action (like a click event) ...

Basically, a custom play button works, but the onLoad = "play ()" event doesn't work.

For example, this would play a movie:



<input type="button" value="Play" onclick="document.myMovie.play()">

      

Whereas the following will do nothing on iOS:

<body onload="document.myMovie.play()">

      

Source taken from:

Can you autoplay HTML5 videos on iPad?

but as for android,

here you go

http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/

+3


source







All Articles