user365045
user365045

Reputation: 43

Is there a way to embed an mp3 player in a website that isn't flash based (so that the website is iPhone OS compatible)

I did a lot of searching for what I thought would be a pretty common question, but I came up with nothing. If there is another thread with a similar topic, please let me know.

Basically, I'm looking for a way to have an .mp3 file play in a website without relying on a flash-based player. I've searched w3 schools and every forum I can think of, but every media player I've found so far has been some sort of proprietary flash player.

Doesn't HTML support some sort of native player? I've found some that rely on Windows Media Player which is close, but I want the player to work on an iPhone and something tells me WMP won't get that done...

PS, as I'm thinking more about this this idea just popped into my head: a javascipt player and inside the <noscript> tag, put a flash player? I'm running a music blog (@ http://www.freshoncampus.com) so the less code per post, the better...

Upvotes: 4

Views: 4647

Answers (4)

unomi
unomi

Reputation: 2672

You could go with something like http://www.schillmania.com/projects/soundmanager2/ which should autodetect the best option to play the sound.

Upvotes: 1

HoverHell
HoverHell

Reputation: 4889

First, HTML5's “audio” tag. Second, you can use “embed” tag — it will play with whatever browser plugin is installed (not just WMP). Not sure what would work in iPhone, though. (and I might be wrong about exact tag names)

Upvotes: 0

Rotsor
Rotsor

Reputation: 13783

jplayer? Not sure about MP3/OGG thing though...

Upvotes: 0

Alan
Alan

Reputation: 46823

Yes you can, with HTML 5.

This is a pretty good explanation of how you might go about doing this.

The caveat is that HTML5 support is not universal, but iOS devices (iphone) have a good start with supporting HTML5.

Edited to add:

From the question, it's hard to discern if you're looking for a way to play multiple mp3's with a nice gui interface, or just use audio as a background.

For the former, you will need to use Javascript to handle controls, and loading of the src element (I'd search for custom built javascript or jquery plugins to handle this).

For the latter, my solution above will work.

Also, background music in a webpage is highly annoying to most users, so caveat emptor.

Upvotes: 3

Related Questions