How can I stream an authenticated user's Google Drive audio file stored on xer Google Drive in my web app?

64 Views Asked by At

How can I stream an authenticated user's private audio file stored on xer Google Drive in my web app?

Previously, I just gave a https://drive.google.com/uc?export=view&id=[file ID] link to the <audio> element, which while never officially recommended, worked for many years until Google just recently stopped letting people use it (consistently returns a 403: Forbidden error).

Now, I am trying to do it “properly”, but I don't see a way to. If I use the webContentLink from gapi.client.drive.files.get, I also get a 403. If I call it with alt: 'media', I can get the file that way, but it seems to retrieve the entire file before I can do anything with it, which isn't ideal for streaming a large audio file.

Is there any way—ideally a “proper” way, but even any way at all at this point—to stream a user's audio file from xer Google Drive to an <audio> element?

0

There are 0 best solutions below