How does the <audio> tag work? And can a file be hosted on Google Drive?


#1

The title says most of it. I can't find a single good example online for the tag. I have an mp3 file and tried hosting it on Google Drive. I've seen two ways to use the tag and neither has worked. Any tips?

Edit: I want the controls off, autoplay (and preload, if necessary) on. As I said before, it's an mp3 file.


#3

I think the link is broken somehow...and do I need to have it as an OGG file too?


#4

No was an example

www.quackit.com/html_5/tags/html_audio_tag.cfm


#5

thank you!! that was very helpful


#6

Can i see your code, or did you get it to work? Only the mp3 file should work, but having a ogg backup isn't bad.


#7

The code's here. It (the audio) doesn't work yet...
Thank you!


#8

Code looks fine to me (checked audio code ) but your link to music isn't right..

When I went to the Google Drive link it was an empty folder..


#9

Hmmm...I thought I knew how to fix that. I did not. Would I be able to link it from soundcloud?


#10

Any link should work just that shouldn't be private


#11

It isn't private, I set it so anyone can view it. The first time it was on my school google drive for various reasons instead of my personal so i copied the file to my personal and thought it would work...it didn't. slightly updated code here.
I tried turning on the controls at one point just to see what would happen and it's perpetually muted or something...is there any way to change that with jQuery or CSS?


#12

You url should end at .mp3 or .ogg, google drive seems to be doing something to the file so you can play it in browser, we don't want this, even google drive can't play the item, can you upload the mp3 file somewhere else?


#13

You cold probably host it on a dropbox free account

https://www.dropboxforum.com/hc/en-us/community/posts/203820445-mp3-URL-ending-with-mp3-

You have to add the raw=1 param to the end.

/foo.mp3?raw=1

Let us know if it works.


#14

It worked on soundcloud, but thank you so much for the suggestion! I may need it in the future:)


#15

I uploaded it to soundcloud and it worked. thank you so much!!