最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

I did a lot of searching for what I thought would be a pretty mon 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 (@ ) so the less code per post, the better...

I did a lot of searching for what I thought would be a pretty mon 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.) so the less code per post, the better...

Share Improve this question asked Jun 12, 2010 at 3:09 user365045user365045 431 silver badge3 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

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.

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

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

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)

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论