I am trying to autoplay youtube videos on android, the same thing as in
How can I autoplay a video using the new embed code style for Youtube?
The following HTML works in google chrome browser, but not in the browser in android emulator.
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/xxxxxxxx?autoplay=1&vq=medium" frameborder="0"></iframe>
Can anyone shed light on this ?
According to this answer, disabling autoplay is slowly becoming a standard in mobile browsers. This is happening to prevent unwanted sound from playing and to conserve battery.
You may want to give the method from this article a shot.
function callback () {
document.querySelector('video').play();
}
window.addEventListener("load", callback, false);
<video poster preload="true">
<source src="video.mp4" type="video/mp4">
</video>
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