Embedding Google Drive videos

Google drive is a handy place to store videos. I find myself having more and more videos saved there since Google added call recording to Google Meet, as the resulting recording gets saved to the organiser's drive. Often those videos need to be shared and embedded elsewhere (internal presentations, etc), but finding the embed code for these videos isn't nearly as simple as with Youtube or Vimeo!

Load the video

Open the video in Google drive, then when it has loaded, click the 3 dots in the top right of the screen. On the panel which appears, click "Open in new window".

Info

Embed item

In the new window which has opened, again click the three dots in the top right, and select "Embed item..."

Embed

Get the code

A modal pops up, which contains the embed code for this video. This code can be pasted wherever the embed needs to be shared.

Embed code

All done?

Not quite! Notice in the previous screenshot the yellow box with Only the owner and explicitly shared collaborators have access. By default, if anyone trying to view the embed doesn't already have access to the underlying video file, the embed won't work.

Google 403 error

This may be desired behaviour in some cases (an internal training video limited to users on the same email domain, for example), but what if we want our video to behave a bit more like Youtube, and be visible by anyone?

If we click the three dots at the top right once more, and select "Share", we have the option to make the file globally-visible.

Share settings

Selecting Anyone with the link then clicking Done means that our embed code should now work for anyone who tries to view it!

Well, almost anyone...

These video embeds are not nearly as reliable as YouTube or Vimeo. If you embed a video, with "anyone with the link"-level access, at the time of writing (Jan 23) it will still only work for some of your users. If your user is logged into a gmail account of any type (gmail.com or Google Apps), it'll work fine. If they're not logged into a gmail account, the video won't play, despite the permission settings appearing to be open to all. This can be quite a pain, as there isn't a good error message shown to users to let them know why this has failed.

Hopefully this is something Google will resolve at some point. Until then, YouTube and Vimeo are still the best bet for videos requiring wide distribution. But if you're looking to embed a Drive-based video for a known audience (or one which you know will all be logged into a gmail account of some description..) then the above guide should do the trick!

Share This Article

Related Articles


A/B testing headlines on social media

A/B testing is a great way to determine the most compelling headline for an article, but is made difficult by the way social media networks cache link previews. What's the secret to effectively running A/B headline tests, and optimising engagement rates?

Lazy loading background images to improve load time performance

Lazy loading of images helps to radically speed up initial page load. Rich site designs often call for background images, which can't be lazily loaded in the same way. How can we keep our designs, while optimising for a fast initial load?

Font Subsetting - shrink down font files to speed up page loads

Fonts are one of the largest resources on any page after images, and can have a big impact on CLS when they vary in size from the underlying system font. Font subsetting allows us to radically shrink font file sizes, speed up initial page loads, and improve our page speed scores.

Calculating rolling averages with Laravel Collections

Rolling averages are perfect for smoothing out time-series data, helping you to gain insight from noisy graphs and tables. This new package adds first-class support to Laravel Collections for rolling average calculation.

Minimising Cumulative Layout Shift (CLS) When Loading Responsive Ads

Responsive ads are a great way to maximise publisher revenue from display ads. Not knowing the size of the ad to be served in advance can have a big impact on Cumulative Layout Shift (CLS), and, ultimately, Google rankings. How do we maximise revenue while minimising CLS impact?

More