dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: Sound controlling with JS

  1. #1
    Join Date
    Nov 2008
    Posts
    16

    Question Sound controlling with JS

    I'm trying to embed streaming sound in my web page by using <embed>, or <audio> or something.
    How can I get Javascript to control the sound (eg start, stop, pause, rewind, forward, skip song, go back)?
    I believe there are functions that you can pass, eg:
    <embed id="whatever" />
    ...
    document.getElementById('whatever').Play();

    I also want to make it play a user-defined playlist....somehow...

    But for the rest I have no idea.

    Thank you.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,666
    To do all that will require the APPLET or OBJECT tag and a module able to be downloaded into the browser from a web site. The following is what you can do without getting into all those complexities:

    http://www.webdeveloper.com/forum/sh...d.php?t=196068

  3. #3
    Join Date
    Nov 2008
    Posts
    16
    That doesn't help too much. All it tells you how to do is to play a sound using outdated browsers... with 2-browser support. I want this to be net-neutral to be honest... so FF3....etc...

    Does anyone know of how to do the other things that I ask? I'd rather the embed method to be honest...

  4. #4
    Join Date
    Feb 2008
    Posts
    1,666
    You're jumping to erroneous conclusions. I use the code shown in FF3 and it works perfectly.

  5. #5
    Join Date
    Nov 2008
    Posts
    16
    I'm quite sure it does.
    That was not my query.
    I don't like using code that goes (If IE then this otherwise this)....
    I wanted the code to control these sounds too, like all the controls, so I can create an Amarok-like control bar.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,666
    As I said, to do that will require the APPLET or OBJECT tag and a module able to be downloaded into the browser from a web site. Such is beyond the scope of a JavaScript forum.

  7. #7
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    Quote Originally Posted by dandart View Post
    I don't like using code that goes (If IE then this otherwise this)....
    /QUOTE]
    LOL!
    you are using the wrong language then!
    or is this the "i have a dream" post?

    anyways,

    since javascript CANNOT do what you want(it was never even a sparkle in Brendon's eye), you will have to use "non-standard" browser plugins to do the job.

    look into the quicktime javascript API; they provide a small JS library that does those things (only for quicktime).
    some of the newer flash video solutions provide their own javascript APIs as well, but were getting off topic at that point.
    Last edited by rnd me; 11-24-2008 at 05:04 PM.

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