Skip to content
Advertisement

Show Google Drive video on a website using service account

I’m trying to get a video from my google drive account and publish it on my website. The idea is to authorize the access to the file using a service account, so the video will be “public” accessible without the user using his google credentials.

Right now for the images I download them and the show it from my server, but due to storage space I would prefer not doing the same for videos

Here’s my code:

JavaScript

right now I tried to get the webContentLink and then put the url I get as source for a video tag, but I get a 403 error, so still I didn’t authorize the access using the service account

Any help would be appreciated

Advertisement

Answer

Embedding the webContentLink to your website won’t make this publicly available. The webContentLink is as restricted as the file itself: it can only be accessed by users with which the file has been shared.

So you should do one of these:

  • Make this video public (via Permissions: create, or through the UI itself) (role: reader and type: anyone).
  • Download it serve it from your server, as with your images.

Related:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement