I wonder if this:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
As you may have noticed, web browsers are moving towards stricter
autoplay policies in order to improve the user experience, minimize
incentives to install ad blockers, and reduce data consumption on
expensive and/or constrained networks. These changes are intended to
give greater control of playback to users and to benefit publishers
with legitimate use cases.
Chrome's autoplay policies are simple:
- Muted autoplay is always allowed.
- Autoplay with sound is allowed if:
- User has interacted with the domain (click, tap, etc.).
- On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
- On mobile, the user has added the site to his or her home screen.
- Top frames can delegate autoplay permission to their iframes to allow autoplay with sound.
Has anything to do with it. I came up with the same problem and the article mentions that the way autoplay will be working from January 2018 (now! ) will be changing.
I have removed an autoplay in my code, and instead used a technique described in this answer
like so:
player = new YT.Player( videoID , {
videoId: youtubeID, // the ID of the video (mentioned above)
playerVars: {
// autoplay: 1, // start automatically
controls: 0, // don't show the controls (we can't click them anyways)
modestbranding: 1, // show smaller logo
loop: 1, // loop when complete
playlist: youtubeID // required for looping, matches the video ID
},
events : {
'onReady' : onPlayerReady
}
});
function onPlayerReady(event) {
player.mute();
player.playVideo();
}
I'm not sure if this constitutes an 'answer' so let me know if you not and I'll remove it.