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
AutoPlay may not work on YouTube due to corrupt cache/data of the browser or corrupt installation of the YouTube mobile application. Moreover, an outdated browser or misconfiguration of your browser like DRM settings, etc. may also cause the error under discussion.
To make an embedded video autoplay, add "&autoplay=1" to the video's embed code right after the video ID (the series of letters that follows "embed/"). Embedded videos that are autoplayed don't increment video views.
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With