Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts

    Need help getting audio to autoplay when page loads - SOLVED

    Hi all. I know not many people are a fan of having audio autoplay when a webpage loads, but trust me I know what I am doing.

    So, a long, long time ago I used bgsound src= to get audio to autoplay on a page in IE. As that does not work with Chrome and FFox, I am looking for an alternative.

    After doing some research, I came across some code that kinda works, but not completely. I currently have:

    <audio controls="controls">
    <source src="/mp3/montage2.mp3" type="audio/mp3" autostart="1">

    When I load the page, I see the graphics for the player. I don't want this viewable; I am assuming I can get rid of that with a noembed tag. In the meantime, if I press the viewable play button, the audio plays. Ok, fine - but I want it to autoplay. I figured autostart="1" would do the trick, but doesn't. Can someone point me in the right direction?

    Thanks in advance.


    Ok, I have it where it's autoplaying.

    <audio controls autoplay>
    <source src="/mp3/montage2.mp3" type="audio/mp3">

    But - the gui is still visible. A noembed tag does not work, nor does adding height="0" width="0"

    Any ideas?

    --edit #2--

    Got it - remove controls

    Last edited by riffwraith; 04-05-2014 at 06:56 PM.


Posting Permissions

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