Playing a sound in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jezternz
    New Member
    • Jan 2008
    • 145

    Playing a sound in javascript

    Is there any efficient way to do this?
    I found you could do it using
    <bgsound> or <embeded>
    Are these efficient and are they xhtml valid?
    Is there no javascript functionality to play sounds?

    Thanks, Josh
  • altonator
    New Member
    • Jan 2008
    • 15

    #2
    Hmmm... without doing some research on Google I don't really know.

    You could do it in Flash and trigger it from Javascript.
    LongTail Video and the JW Player has a media player that has a javascript API, so you could load the jukebox into a hidden <div> somewhere and then use javascript to tell it which sound to play and when.

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #3
      there is no JavaScript-method that plays sound ... but i think you may go for the <object>-tag

      kind regards

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        See Playing Sounds In The Browser - use a browser helper object.

        Comment

        Working...