How to fix Google Drive video embeds not playing?


A lot of our keynote videos are hosted on Google Drive to allow for cheap hosting and an ad-free experience. However, you may experience that these videos don't play in your browser. This is especially known to be true on Safari's default installation on iOS and macOS. You may experience that despite clicking on the play button, nothing happens, as per below.


How to fix

On Mac/PC

Option 1: Use Chrome or Firefox

The issue is due to a poor support of one of Safari's privacy features (see below for details). If you can switch to a different browser, such as Chrome or Firefox, you should be able to play the video without hiccups.

Option 2: Turn off "Prevent cross-site tracking" on Safari

Another workaround is to (temporarily) turn off the Safari feature that is causing the problem. Go to Safari Preferences > Privacy and uncheck "Prevent cross-site tracking". Reload the page and the video should now play fine.

On iOS

Your only option on iOS/iPad OS is to turn off Cross-site tracking prevention on Safari to watch the video — you can safely turn it back on after watching.

  1. Open your device's Settings app
  2. Scroll down to Safari and tap it
  3. Scroll down to the "Privacy & Security" section and un-toggle "Prevent Cross-Site Tracking"

Why is this happening? For the nerds

In short, because of a bad handling of Safari's Intelligent Tracking Prevention (ITP) by Google Drive.

Indeed, Google Drive needs to know what your Google account is to check if you have permission to watch shared videos. This is because Drive is not usually used to share things publicly. In this website's case, this check is useless as all videos are public and hence, don't need to know who you are to be played. But no matter, Drive will try and check this all the time anyway.

To achieve this, Drive will try and read your Google cookies to find what your Google User ID is. Because this website is not hosted on google.com, Google's cookies are considered "third-party cookies" and reading them on this website is considered "cross-site tracking" by Safari. This is blocked by Safari ITP, resulting in the error in video playback that your experienced.

ITP has a way to prevent this from happening for legitimate use cases like this one. It involves using a a dedicated Storage Access API, which specifically supports third-party embeds which are invoked by a user action (in our case, clicking the Play button on the video). If Google Drive were to support this —like YouTube or Facebook do— ITP would not block cookie access, and the videos would play just fine.

Unfortunately, this use case isn't a typical one for Google Drive and hence, this is probably super low on the Drive team's priority list and unlikely to ever get fixed. They would probably encourage us to use YouTube instead, which is not an option for most of our videos. This has been reported by multiple people on StackOverflow, Apple User Community, and Github, with no known fix. For now, we have to resort to the unpleasant workaround described above to let people enjoy these videos.

If you are aware of a workaround which does not involve switching away from Google Drive, please reach out to me on Twitter at @SteveJobsFeed.