I AM LISTENING TO
|

WHAT I LIKE

Inherit and extend events from parent in Backbone Doing Metaboxes in WordPress the easy way
Development     HTML5     Javascript     PHP    

Hosting MP3 files on Google Drive + HTML5 Audio Player



27. April 2015

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.

We use a simple Regex to extract the ID:

PHP

JAVASCRIPT

That ID can than be used to embed the file directly using HTML5 audio controls. Its important to use the “http://docs.google.com/uc?export=open&id=” url to open the file, as it provides the direct access to the shared file

 




4
Leave a Reply

avatar
2 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
Henrik HärkönenkamelloAlexJoe Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Joe
Guest
Joe

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

kamello
Guest
kamello

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

Consent to data storage according to DSGVO
Consent to data storage according to DSGVO
Henrik Härkönen
Guest
Henrik Härkönen

Thanks, this was brilliant!

Consent to data storage according to DSGVO
Consent to data storage according to DSGVO