Since Chrome update to version 72, my custom player that runs over the YouTube Iframe API stopped working. It still works perfectly on Firefox or Chrome <= 71.
Using the code below, when function play() is triggered, the video starts buffering and then stops, without playing.
function onYouTubeIframeAPIReady() {
ytIframe = $("#player")[0];
ytPlayer = new YT.Player(ytIframe, {
events: {
'onReady': () => {},
'onStateChange': () => {}
}
});
}
function play() {
ytPlayer.playVideo();
}
The only way to make it work is to embed the video using the mute=1
url param on the iframe src. But even when I do this, if I try to unmute the player after the playVideo (using ytPlayer.unMute()
), the video stops again.
Any ideas on what has changed with this Chrome 72 update? Is this a YouTube/Chrome bug or is it an expected behavior?
Thanks!