Youtube Autoplay Not Working on Mobile Devices With Embedded Html5 Player

Youtube autoplay not working on mobile devices with embedded HTML5 player

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

autoplay not working on mobile devices YouTube video

you can add the following code in the end of the onPlayerReady function:

if(window.innerWidth < 768) {
player.playVideo();
}

This code will start playing the video on mobile devices by checking the screen size.

Youtube embedded video: autoplay feature not working in iphone

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.



Related Topics



Leave a reply



Submit