When I attempt to create a YouTube iframe player with autoplay
in a Google Chrome tab that doesn't have focus the video won't start until the tab gains focus. Even manually calling playVideo
won't get the video to play. At first I thought this was part of the new feature that prevents YouTube videos from playing in newly opened tabs, but this only seems to effect Google Chrome.
You can replicate the issue in the wild by doing the following:
- Go to http://www.tandem.io and create a room
- Go to your newly created room in Chrome AND firefox (or Opera)
- Mute the player in Opera
- Make sure the Chrome tab does not have focus
- Add a YouTube video to the playlist in Opera
- The video won't play in Chrome until the tab/window is active