Youtube embedded video: autoplay feature not working in iphone
I have a youtube embeded video link in HTML5 page, which I want to autoplay.
The following code works in browsers, but in iphone; its not working and needs an extra click.
<iframe type="text/html" width="125" height="100" src="http://www.youtube.com/embed/d_g0251EfB8?autoplay=1" frameborder="0"></iframe>
what to do
Solution 1:
It can't be done. For various reasons (including, but not limited to data usage), Apple doesn't allow auto-playing of videos.
See the accepted answer to this question.
Solution 2:
UPDATE :
iOS 10+ now allows auto-play on HTML5 < video> elements, just have to mute the audio on elements. Youtube will still not. Android is still SOL too, but hey, its a start!
SAMPLE:
<video autoplay muted>
<source src="movie.mp4" type="video/mp4">
Sadly, your browser does not support the video tag X_x
</video>
INFO SOURCE: https://webkit.org/blog/6784/new-video-policies-for-ios/