Results 1 to 8 of 8

Thread: Music in a Webpage

  1. #1
    Join Date
    Nov 2008
    Beans
    18

    Music in a Webpage

    My friends have recently set up a new server, to fool around with PHP and whatnot. Things are going along fine, but I would like the server to be able to play music in the background of a webpage. Yes, I know that this is a bad idea to have music looping in the background, but this is something that I would like to learn.

    I am viewing the webpages in Firefox, and I was wondering if there were any easy HTML tags that I could insert to get the music to loop indefinitely in the background. Any help would be appreciated!

  2. #2
    Join Date
    Feb 2009
    Location
    Somewhere in Quebec
    Beans
    50
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Music in a Webpage

    Here is an example code, which I already used before (might be HTML 4.1 and not XHTML 2.0):

    HTML Code:
    <embed name="courage" src="/music/aaf/courage.mp3" loop="true" hidden="false" autostart="true"></embed>
    "Sometimes love isn't about how much someone suits you, but how much you're willing to change to suit them"
    99% of bugs in Linux are right between the keyboard and the chair you're currently sitting in!

  3. #3
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Music in a Webpage

    Quote Originally Posted by Firestom View Post
    Here is an example code, which I already used before (might be HTML 4.1 and not XHTML 2.0):

    HTML Code:
    <embed name="courage" src="/music/aaf/courage.mp3" loop="true" hidden="false" autostart="true"></embed>
    Sorry to hijack the thread, but I tried this in my webpage. The audio file plays, yet a video pane appears. Is this possibly because of the file association Firefox has wrt playing mp3 files? Firefox is setup to use mplayerplug-in 3.55. Can you recommend a better plugin that I can use/install that just plays audio and that does not (attempt to) play video?

  4. #4
    Join Date
    Nov 2008
    Beans
    18

    Re: Music in a Webpage

    I'm tried your HTML, but I'm not hearing any music.
    The page I'm trying it on is here

    Any other ideas?
    Last edited by ultblad1; April 20th, 2009 at 02:56 AM.

  5. #5
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Music in a Webpage

    Quote Originally Posted by ultblad1 View Post
    I'm tried you HTML, but I'm not hearing any music.
    The page I'm trying it on is here

    Any other ideas?
    set hidden="false"

  6. #6
    Join Date
    Nov 2008
    Beans
    18

    Re: Music in a Webpage

    I tried that too but nothing happened.

  7. #7
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Music in a Webpage

    Quote Originally Posted by ultblad1 View Post
    I tried that too but nothing happened.
    This is my first time doing this too. But it worked for me; could it possible be that your browser has no file-association setup for MP3 files? Check your browser's preferences. With Firefox, Edit->Preferences, then click on "Applications". Afterwards, search for mp3.

  8. #8
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Music in a Webpage

    I found this reference, and a few others, that basic state the same... embedding mp3 music in a webpage differs when serving content to Mozilla (i.e. Firefox) and IE.

    One thing that I found that I needed to do to stream an mp3 remotely was to rename the file with an m3u extension. I was unable to stream the music when the mp3 extension was used.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •