Search code examples
htmlmobileyoutubefancyboxoverlay

Youtube autoplay not working on mobile devices with embedded HTML5 player


To my problem, I have one link <a href="http://www.youtube.com/embed/YT-ID" class="overlay_video"></a>. I want to play the video by clicking the link in a fancybox overlay window. This is not a problem. The problem is the parameters, for example "autoplay" or "autohide".

The following link doesn't work:

<a href="http://www.youtube.com/embed/YT-ID?autoplay=1" class="overlay_video"></a>

The Overlay-Window opened, but the video is not playing automatically.

EDIT: I want to use the HTML5 Player on mobile devices. On a desktop-browser it works with the parameters, but not on mobile devices.


Solution

  • As it turns out, autoplay cannot be done on iOS devices (iPhone, iPad, iPod touch) and Android.

    See https://stackoverflow.com/a/8142187/2054512 and https://stackoverflow.com/a/3056220/2054512