Daugilas / lazyYT

A jQuery plugin to lazy load those dang Youtube iframe videos.
Other
56 stars 14 forks source link

Have to click twice to play on touch devices #8

Open emwee opened 8 years ago

emwee commented 8 years ago

With touch enabled I need to click twice to play the video.

On http://www.newmediacampaigns.com/blog/lazyytjs-a-jquery-plugin-to-lazy-load-youtube-videos I read "Apple prohibits video elements from autoplaying, which is causing the double click issue on iOS." but I can reproduce this on every touch device.

Is there a workaround for this?

Daugilas commented 8 years ago

I have created a branch addressing this issue "autoplay_on_mobile".

Here I tried to include YT js API and Play video via code after it loads an iframe (https://github.com/Daugilas/lazyYT/commit/47bd3d0fc891c73311e1c95d9369aaa567f705a7). Unfortunately it worked only on an old Android phone with native browser. iPhone tests failed and Chrome on Android also fialed...