1

Hello.I´ve been making my first html page and
I´m trying to implement an audio file in the background of the page without the control section. I have something like this,but the audio doesn´t plays:

<audio autoplay loop>
<source src="audio_route" type="audio/mp3">
</audio>

Any help will be welcome : )

Comments
  • 17
    Here's help: DON'T DO THAT SHIT. It's totally annoying and one of the things you just never do, just like auto-playing video.
  • 5
  • 5
    Browser permissions will also block auto play.

    But out of experience - the only sound that should be blasting through my headphones, is the sound I explicitly expect to be blasting through my headphones.

    As for your HTML:
    It works fine, as long as the path/to/file.MP3 is right and your browser isn't blocking it.
  • 3
    Make sure your windows xp Maschine supports mp3‘s
  • 0
    @Fast-Nop I know it's not a good idea, but it's just to know how to do it.
  • 0
    @C0D4 okay, I see that is not a good ideai think I will not implement it in the future.
  • 0
    @guarrions I'd guess you have the wrong filename. The extension is missing. Also, the type doesn't look correct, should be "audio/mpeg".
  • 3
    NEVER do that
  • 3
    Stop.

    Hammer time.
  • 0
    Maybe see how they did this one:

    http://www.nooooooooooooooo.com/

    It is triggered though.
  • 3
    Btw., it also fucks up accessibility because blind people relying on screenreaders suddenly get drowned in unexpected sound.
  • 1
    @Fast-Nop I hadn't thought of that. Thanks for the help.
  • 2
    just NO. dont do any fucking autoplay shit. ask yourself: did user asked to play any media? it should only be on demand.
  • 0
    Since when devrant became stackoverflow?
  • 1
    Ahhhh.

    Create an audio. Create a button. Tie audio playback start to that button’s onclick. Now click() the button.

    ...and go confront your boss about it. Audio autoplay almost always means ragequit.
  • 1
    firstly, don't do that shit.

    secondly, this is devrant, not stackoverflow.
Add Comment