mouseover image and object sound and preset volume level?

Discussion in 'Javascript' started by murrayatuptowngallery, Nov 1, 2005.

  1. I have looked at some mouseover/ sound object scripts and can't get
    them to work. Most were more complex than needed and introduced several
    new parameters for me.

    I found a simple pair of html code segments that accomplish display of
    an image and automatic 'display' (playback) of a .wav file, and
    apparently are usable for both IE and NS,

    "
    <object height="100%" width="100%"
    type="image/jpeg" data="picture.jpeg">
    </object>
    "
    Displays an image.


    "
    <object
    height="50%"
    width="50%"
    classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
    <param name="AutoStart" value="1" />
    <param name="FileName" value="sound.wav" />
    </object>
    "
    Plays the sound without needing click on a player button.

    Some questions:

    1) What does the clsid: part refer to ? It doesn't work if that line is
    removed.

    2) What is the simplest way to play the sound with a mouseover the
    image?

    3) Is is possible to preset the playback volume with the 'object'
    method? The default seemed obnoxiously loud to me.

    Thank you

    murray
    murrayatuptowngallery, Nov 1, 2005
    #1
    1. Advertising

  2. murrayatuptowngallery wrote:

    > <object
    > height="50%"
    > width="50%"
    > classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
    > <param name="AutoStart" value="1" />
    > <param name="FileName" value="sound.wav" />
    > </object>
    > "
    > Plays the sound without needing click on a player button.


    Provided that there is a player plugin set up for the used user agent.

    > [...]
    > 1) What does the clsid: part refer to ?


    The CLSID (class ID) of the respective ActiveX control/COM class object.
    You can find out which CLSID refers to which object by having a look into
    the `HKCR\CLSID' or `HKLM\Software\Classes\CLSID' Windows Registry
    subtrees.

    <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/hkey_classes_root_key.asp>

    > It doesn't work if that line is removed.


    It probably does not work _in IE for Windows_ if the `clsid' attribute is
    removed, since IE probably requires the signature of a control, depending
    on the Security Level set for it.

    This was not a JS question.

    > 2) What is the simplest way to play the sound with a mouseover the
    > image?


    <img ... onmouseover="referenceToPlayMethod(...)"

    See e.g. MSDN Library for details.

    > 3) Is is possible to preset the playback volume with the 'object'
    > method? The default seemed obnoxiously loud to me.


    Probably, but since there is no standardized plugin interface yet, it will
    not work cross-browser and therefore has to be feature-tested before used.
    See MSDN Library for that, too. Google is your friend. [psf 6.1]


    PointedEars
    Thomas 'PointedEars' Lahn, Nov 1, 2005
    #2
    1. Advertising

  3. murrayatuptowngallery

    VK Guest

    murrayatuptowngallery wrote:
    > <object height="100%" width="100%"
    > type="image/jpeg" data="picture.jpeg">
    > </object>


    Old good <img src="myImage.gif" name="Image01"> would be better.


    > <object
    > height="50%"
    > width="50%"
    > classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
    > <param name="AutoStart" value="1" />
    > <param name="FileName" value="sound.wav" />
    > </object>
    > "
    > Plays the sound without needing click on a player button.
    >
    > Some questions:
    >
    > 1) What does the clsid: part refer to ? It doesn't work if that line is
    > removed.


    You're inserting Windows Media Player control onto your page. The line
    of question refers to the Clacc ID under which Windows Media Player
    ActiveX control is registred on the client machine.
    Wrom here you may guess that:
    1) User system has to be Windows 98 or higher
    2) Windows Media Player v.7.x has to be installed (lower and higher
    versions are using sometimes different CLASSID's for registration; so
    user may be asked to download ActiveX control despite she already has
    Windows Media Player installed).

    > 2) What is the simplest way to play the sound with a mouseover the
    > image?


    Use Macromedia Flash. It's also the only one reliable way to cover
    other systems besides Windows.

    > 3) Is is possible to preset the playback volume with the 'object'
    > method? The default seemed obnoxiously loud to me.


    The volume depends on system volume settings. You can set volume
    programmatically within the provided system range (other words you
    cannot programmatically turn the volume regulator on user's
    loudspeakers ;-)

    Use Macromedia Flash instead. If you don't want it, don't bother with
    <object> as it stays Windows-exclusive anyway. It is much simplier then
    to manupulate <bgsound> object (and it doesn't require Media Player
    installed).
    VK, Nov 1, 2005
    #3
  4. Thanks, P-E.

    I thought the conglomerate mess fell under JS because of the mouseover.
    My error.

    I did get the hypergurl mouseover play script to work. I somehow
    eliminated whatever problem I had initially had.

    I DO try to search first. Sometimes the answer is tougher for me than
    the question!

    I guess regarding the volume, people will have their volume set to
    wherever THEY are comfortable.


    Thanks.

    Murray
    murrayatuptowngallery, Nov 1, 2005
    #4
  5. murrayatuptowngallery wrote:

    > I DO try to search first. Sometimes the answer is tougher for me than
    > the question!


    ACK

    > I guess regarding the volume, people will have their volume set to
    > wherever THEY are comfortable.


    I rather think that people will be most comfortable if you do not force
    another sound upon them. They may have their MP3 player application
    running in the background and your additional sound interferes. So
    unless you deem it absolutely necessary (for example do to the nature
    of the provided content), you should refrain from doing so.

    > Thanks.


    You're welcome.

    And please read <http://jibbering.com/faq/> on quoting.


    PointedEars
    Thomas 'PointedEars' Lahn, Nov 1, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Morgan Kejerhag

    Changing system sound volume

    Morgan Kejerhag, May 20, 2004, in forum: Java
    Replies:
    3
    Views:
    448
    Yu SONG
    May 21, 2004
  2. simon kagwe

    Changing sound volume

    simon kagwe, Jun 23, 2007, in forum: Python
    Replies:
    5
    Views:
    369
    Lenard Lindstrom
    Jun 25, 2007
  3. Nugs
    Replies:
    1
    Views:
    132
    Marcio Kleemann
    May 26, 2004
  4. Peter Amberg
    Replies:
    13
    Views:
    172
    Thomas 'PointedEars' Lahn
    Apr 5, 2004
  5. Thomas Pedersen

    Volume sound script

    Thomas Pedersen, Jan 8, 2008, in forum: Javascript
    Replies:
    0
    Views:
    65
    Thomas Pedersen
    Jan 8, 2008
Loading...

Share This Page