www.webdeveloper.com
Results 1 to 4 of 4

Thread: Audio Element issue with Firefox

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    4

    Audio Element issue with Firefox

    Code:
    var audioElement = document.createElement("audio");
    audioElement.setAttribute("src", "media/sounds/song.mp3");
    audioElement.load()
    $(".play").click(function() {
    	audioElement.play();
    	}
    });
    HTML Code:
    <a class="play">Play</a>
    This is code I copied from an online demo and the demo works fine in Chrome & Mozilla (oddly not Safari), but I can't seem to get mine to work in Mozilla. I have tried hard coding the audio tag into the html, works for Chrome and Safari, but no luck with Mozilla. I know the audio element is not final spec but I was hoping for some insight.

  2. #2
    Join Date
    Apr 2010
    Posts
    4
    HTML Code:
    <a class='play' href='#'>Play</a>
    the href is included in my scripts but I forgot to add it when typing it out

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    I figured out the issue, mozilla can only handle OGG and WAV files for the time being.

  4. #4
    Join Date
    Apr 2010
    Posts
    4
    haha sorry, last reply to my own thread.
    Safari does not handle OGG files ... what a headache.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles