Specific HTML question about music on site

10 replies
  • WEB DESIGN
  • |
Hello Folks.
I am attempting to embed music onto a website so that it plays automatically when someone goes to the page.

This is the code I am using under the Head:



Code:
<embed src="song.mp3" autostart="true"
hidden="false" loop="false">
<noembed><bgsound src="song.mp3"
loop="1"></noembed>
Everything is working exactly the way I want it to when it comes to the music. My problem is that it is changing the background color?! :confused:

Any idea on what is causing this, and how to fix it?


Thanks in advance!
#html #music #question #site #specific
  • Profile picture of the author iuditg
    Changing the background of what, your site ? Can you please provide some more details. Shoot me a PM and I will help you out with your issue. Or post your details here and just give me a PM and I will reply in the thread and would try to help you out
    {{ DiscussionBoard.errors[5679976].message }}
  • Profile picture of the author shantanu
    <embed src="http://www.yoursite.com/music/musicfile.wav" autostart="true" loop="false" hidden="true">

    here you go this is tested code by me this eve.
    {{ DiscussionBoard.errors[5680498].message }}
  • Profile picture of the author kokopelli
    Embedding music in a web page that plays automatically, without giving the visitor the option to turn it on/off, is bad form IMHO. It was the norm, maybe 12 years ago, but not anymore ...
    Signature
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {{ DiscussionBoard.errors[5682007].message }}
    • Profile picture of the author MikeTucker
      Originally Posted by iuditg View Post

      Changing the background of what, your site ? Can you please provide some more details. Shoot me a PM and I will help you out with your issue. Or post your details here and just give me a PM and I will reply in the thread and would try to help you out
      Yes, the background of the entire page. I set it to #FFFFFF but whenever I add the code to play the music, it changes to some bright blue color.

      Sure, I will PM you.



      Originally Posted by shantanu View Post

      <embed src="http://www.yoursite.com/music/musicfile.wav" autostart="true" loop="false" hidden="true">

      here you go this is tested code by me this eve.
      So you are suggesting that I use a .wav rather than an mp3 file?



      Originally Posted by kokopelli View Post

      Embedding music in a web page that plays automatically, without giving the visitor the option to turn it on/off, is bad form IMHO. It was the norm, maybe 12 years ago, but not anymore ...
      If this is directed at me, please note that the code I listed very clearly gives the option for the user to control the music should they wish to do so.
      Signature

      The bartender says: "We don't serve faster-than-light particles here."

      ...A tachyon enters a bar.

      {{ DiscussionBoard.errors[5683125].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by MikeTucker View Post

        If this is directed at me, please note that the code I listed very clearly gives the option for the user to control the music should they wish to do so.
        Incorrect: your code says:

        Code:
        autostart="true"
        Have you ever forgot your speakers on with quite a high volume and went to visit a site at 12:30am? Did your whole family wake up when the speakers started to play automatically the music set up in this way by a "smart" webmaster?

        Autostart music is bad. Very bad... I can't imagine anybody would be able to defend the autostart="true" decision!
        :rolleyes:
        Signature

        {{ DiscussionBoard.errors[5696121].message }}
        • Profile picture of the author MikeTucker
          Originally Posted by Istvan Horvath View Post

          Incorrect: your code says:

          Code:
          autostart="true"
          Have you ever forgot your speakers on with quite a high volume and went to visit a site at 12:30am? Did your whole family wake up when the speakers started to play automatically the music
          LOL yeah, okay, the autostart feature. Well, if someone left their speakers up too high and they are online at midnight-thirty, that is their concern, not mine.

          It takes 2 or 3 seconds to start playing, and the control is obvious, so if they want to pause or stop the song (or repeat it) they have full control to do so. And if it doesn't, well then like I said... I'm not the one that left their speakers turned up.



          Originally Posted by Istvan Horvath View Post

          set up in this way by a "smart" webmaster?
          Felt the need to add that, did you? lmao... I thought the very nature of the question would show this is the first time I've ever tried to code anything? :rolleyes:



          Originally Posted by Istvan Horvath View Post

          Autostart music is bad. Very bad... I can't imagine anybody would be able to defend the autostart="true" decision!
          :rolleyes:

          It's not uncommon in this niche. In fact, one site uses it quite well, with members talking about the "song of the day" in the forum... Sometimes music is even released for the first time on that site and autoplays when you log in.



          ****

          I'll try the HTML5 tonight. Thanks for the advice!
          Signature

          The bartender says: "We don't serve faster-than-light particles here."

          ...A tachyon enters a bar.

          {{ DiscussionBoard.errors[5697654].message }}
  • Profile picture of the author Shounak Gupte
    try using HTML5 audio tag

    HTML5 audio tag
    Signature
    Looking for a quality but affordable graphic designer to partner with. To express your interest PM me with some samples.
    {{ DiscussionBoard.errors[5684049].message }}
    • Profile picture of the author MikeTucker
      Originally Posted by Shounak Gupte View Post

      try using HTML5 audio tag

      HTML5 audio tag

      Thank you, I will check this out!
      Signature

      The bartender says: "We don't serve faster-than-light particles here."

      ...A tachyon enters a bar.

      {{ DiscussionBoard.errors[5691268].message }}
  • Profile picture of the author K Meier
    Ouch, bgsound tag! I remember when I created one of my first website back 11 years ago, I used that to play midi files. Don't use that nowadays, it's very out dated and people will leave your site if they can't turn the music on.

    HTML5 audio should be way better, or simply use a flash player.
    {{ DiscussionBoard.errors[5695832].message }}
  • Profile picture of the author webpeon
    Originally Posted by MikeTucker View Post

    Code:
    <embed src="song.mp3" autostart="true"
    hidden="false" loop="false">
    <noembed><bgsound src="song.mp3"
    loop="1"></noembed>

    I doubt it'll make much difference but there's no closing tag on the embed element
    Signature
    Web 2 Mobile
    The Future of The Web
    {{ DiscussionBoard.errors[5698865].message }}

Trending Topics