9
votes

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 ?

2
Any luck on this... 2 years later?Langdon
+1 to this post. No solution is found yet.xandy

2 Answers

1
votes

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>
0
votes

Try this. Note replace videoLink with the embed URL from YouTube.

src=//videoLink?autoplay=1