I AM LISTENING TO
|
WHAT I LIKE
  • English
  • German

Hosting MP3 files on Google Drive + HTML5 Audio Player

1. November 2021








Hosting MP3 files on Google Drive + HTML5 Audio Player

What Google Drive Sharing offers us!

I am doing a Podcast on portalZINE.TV since last year and always host a backup of the MP3 episodes on Google Drive.

The link that you create, when enabling file sharing on Google Drive, can not be used to actually embed it on your website.

The link looks something like that:

To actually use it directly, we need to get the ID. Sure, you  could just extract the ID, but often we just want to copy and paste. The sharing link is also your actual reference to the original file, which I store together with the podcast.

Apply a simple RegEX

We use a simple Regex to extract the ID:

PHP

JAVASCRIPT

Just use it!

This ID can than be used to embed the file directly using HTML5 audio controls.

Its important to use the “https://docs.google.com/uc?export=open&id=” url to open the file, as it provides the direct access to the shared file




Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Joe
Joe
6 years ago

Hey, can you contact me about this. Im trying to make it work but its not working.

kamello
kamello
4 years ago
Reply to  Joe

Thank you a lot!!! it’s what i’m looking for! Thanks again for sharing

Henrik Härkönen
Henrik Härkönen
4 years ago

Thanks, this was brilliant!

gest
gest
3 years ago

this doesn work more duh?

CuriousGuy
CuriousGuy
2 years ago

Ok. I believe this doesn`t work anymore. Please can you update us? Sept 2020.

CuriousGuy
CuriousGuy
2 years ago

I am sorry for not being specific. I mean this works for desktop applications. However if I try to enter a website from a smartphone this doesn`t work. I may have have been doing something wrong. If you have any thoughts on the matter, please let us be enlightened!




Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs

 

I love programming,  design and know my way around server architecture as well.  I would never feel complete, with one of these missing.

I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest.

Apart from that, I am a peace loving guy who tries to have people around him that think the same.  I truly believe in the principle: “If you help someone, someone will help you, when you need it."

Previous Next