Adding Music (mp3 file) to the background of a webpage.

Posted on 2009-02-16
Last Modified: 2013-11-19
What is the best way to have an mp3 file play in the background of one web page.  Looking for something that will work across many browsers.
Currently using <bgsound src="/sample.mp3"> and it only seems to work in IE.
Question by:livewirewebsolutions
    LVL 8

    Expert Comment


    <embed src="yourmusic.mid">
    <noembed> <bgsound src="yourmusic.mid"> </noembed>

    place it in the < head>
    LVL 15

    Expert Comment

    i think a flash mp3 player is the best solution...

    Author Comment

    I placed the below code in my <head> and a Quicktime Q appeared in the right corner  then turned to an mp3 player.

    <embed src="yourmusic.mid">
    <noembed> <bgsound src="yourmusic.mid"> </noembed>

    How do I do this with no player appearing?
    How do I embed the music with a flash player?

    LVL 15

    Expert Comment

    LVL 1

    Accepted Solution

    To code HTML, try to refer from this link:

    If you prefer to use player, refer to this link:

    From my view, it is best to use HTML code as it is not using any scripts or Active X that may deactivated by some users.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now