Do you hear something in Netscape, Opera, Mozilla ?

Discussion in 'Javascript' started by Asterbing, Dec 1, 2005.

  1. Asterbing

    Asterbing Guest

    Hello,

    Here is a page which contains an "evoluated" (to distinguish-it from the
    simple one) way to hear sound on a html page event. From my memory, it
    worked under all major browsers, but didn't succeed these last days.

    I've just tried it today under IE6, Netscape 7, Mozilla 7 and Opera 1.6.
    And it only works under IE.

    Could you try, please. Is it the same for you ?

    Here is the entire HTML file :
    ------------------------------
    <html>
    <head>
    <!-- SOUND CODE (for évoluated way)
    NB : not in external .js due to pb on insertAdjacentHTML -->
    <script type="text/javascript" language="JavaScript"><!--
    var arPreloadSounds = new Array();
    arPreloadSounds[0] = "sound.wav"; // sounds to preload :

    document.write('<BGSOUND ID="auIEContainer">');
    var IE=(navigator.appVersion.indexOf("MSIE")!=-1 && document.all)?1:0;
    var NS=(navigator.appName=="Netscape"&&navigator.plugins["LiveAudio"])?
    1:0;
    var ver4 = IE||NS? 1:0;

    function PreloadSounds()
    {
    var Str;

    if (!ver4)
    return;

    if (NS)
    {
    auEmb = new Layer(0,window);
    }
    else
    {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }

    Str = '';
    for (i=0; i<arPreloadSounds.length; i++)
    Str += "<EMBED SRC='" + arPreloadSounds + "'
    AUTOSTART='FALSE' HIDDEN='TRUE'>";

    if (IE)
    {
    auEmb.innerHTML = Str;
    }
    else
    {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }

    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = AudioControl;
    }

    function AudioControl(whSound,play)
    {
    if (IE)
    this.src = play? arPreloadSounds[whSound]:'';
    else
    eval("this.document.embeds[whSound]." + (play? "play
    ()":"stop()"));
    }

    function PlaySound(whSound)
    {
    if (window.auCon)
    auCon.control(whSound,true);
    }

    function StopSound(whSound)
    {
    if (window.auCon)
    auCon.control(whSound,false);
    }
    //--></script>
    </head>
    <body>
    <!-- SIMPLE WAY (IE ONLY) -->
    <bgsound id=music loop=1 autostart="false">
    <a href="#" onMouseOver="document.all.music.src='sound.wav'">SIMPLE WAY
    </a><p>

    <!-- EVOLUATED WAY (CROSS-BROWSER CONSIDERATION)
    ***TODO : doesn't seems to work under NN7, Mozilla 7 and Opera 1.6
    ???
    -->
    <a href="#" onMouseOver="PlaySound(0);">EVOLUATED WAY</a><p>
    </body>
    </html>
    Asterbing, Dec 1, 2005
    #1
    1. Advertising

  2. Asterbing

    VK Guest

    Asterbing wrote:
    > Hello,
    >
    > Here is a page which contains an "evoluated" (to distinguish-it from the
    > simple one) way to hear sound on a html page event. From my memory, it
    > worked under all major browsers, but didn't succeed these last days.
    >
    > I've just tried it today under IE6, Netscape 7, Mozilla 7 and Opera 1.6.
    > And it only works under IE.


    Yes, this is an old IE4 / NN4 cross-browser media script.
    It uses <bgsound> object in IE and Java-based Bitnik Software plugin in
    NN (with was build in NN 4.x).

    NN 4 is gone as well as Bitnik Software itself (I even not sure if I
    spelled it properly Bitnik? Bitnick? Bitnique? Sounded alike anyway).

    AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
    provide a build-in media interface (?) So a scriptable Flash movie is
    the only option (?)
    VK, Dec 1, 2005
    #2
    1. Advertising

  3. Asterbing

    Randy Webb Guest

    VK said the following on 12/1/2005 10:28 AM:
    > Asterbing wrote:
    >
    >>Hello,
    >>
    >>Here is a page which contains an "evoluated" (to distinguish-it from the
    >>simple one) way to hear sound on a html page event. From my memory, it
    >>worked under all major browsers, but didn't succeed these last days.
    >>
    >>I've just tried it today under IE6, Netscape 7, Mozilla 7 and Opera 1.6.
    >>And it only works under IE.

    >
    >
    > Yes, this is an old IE4 / NN4 cross-browser media script.
    > It uses <bgsound> object in IE and Java-based Bitnik Software plugin in
    > NN (with was build in NN 4.x).
    >
    > NN 4 is gone as well as Bitnik Software itself (I even not sure if I
    > spelled it properly Bitnik? Bitnick? Bitnique? Sounded alike anyway).
    >
    > AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
    > provide a build-in media interface (?) So a scriptable Flash movie is
    > the only option (?)
    >


    <embed src="................

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Dec 1, 2005
    #3
  4. VK wrote:

    > Yes, this is an old IE4 / NN4 cross-browser media script.
    > It uses <bgsound> object


    You mean the `bgsound' _element_, which is not Valid HTML.

    > in IE and Java-based Bitnik Software plugin in
    > NN (with was build in NN 4.x).
    >
    > NN 4 is gone as well as Bitnik Software itself


    Neither is gone. As for the latter, it is only that Beatnik, Inc. has
    discontinued its support. There are no new versions of that plugin
    available:

    > (I even not sure if I spelled it properly Bitnik? Bitnick? Bitnique?
    > Sounded alike anyway).


    <URL:http://www.beatnik.com/products/player.html>

    > AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
    > provide a build-in media interface (?)


    True, because that interface has always been provided by the plugin,
    to be accessed through the DOM. Joined efforts of the major vendors
    to standardize the former have begun some time ago:

    <URL:http://www.mozilla.org/press/mozilla-2004-06-30.html>

    BTW: Forget about `embed', that is not Valid HTML either. Use the
    `object' element from HTML 4.01 instead, supported in the named
    browsers. Be sure to use its content to provide for an alternative
    in case it is not supported (I think a visible hyperlink to the used
    media would suffice.)

    > So a scriptable Flash movie is the only option (?)


    It is not. However, depending on the target environment, it is probably
    the most reliable and fastest option (even though it requires another
    plugin, the Macromedia Flash Player Plug-in).


    PointedEars
    Thomas 'PointedEars' Lahn, Dec 2, 2005
    #4
  5. Asterbing

    Asterbing Guest

    In article <>,
    says...
    > VK wrote:
    >
    > > Yes, this is an old IE4 / NN4 cross-browser media script.
    > > It uses <bgsound> object

    >
    > You mean the `bgsound' _element_, which is not Valid HTML.
    >
    > > in IE and Java-based Bitnik Software plugin in
    > > NN (with was build in NN 4.x).
    > >
    > > NN 4 is gone as well as Bitnik Software itself

    >
    > Neither is gone. As for the latter, it is only that Beatnik, Inc. has
    > discontinued its support. There are no new versions of that plugin
    > available:
    >
    > > (I even not sure if I spelled it properly Bitnik? Bitnick? Bitnique?
    > > Sounded alike anyway).

    >
    > <URL:http://www.beatnik.com/products/player.html>
    >
    > > AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
    > > provide a build-in media interface (?)

    >
    > True, because that interface has always been provided by the plugin,
    > to be accessed through the DOM. Joined efforts of the major vendors
    > to standardize the former have begun some time ago:
    >
    > <URL:http://www.mozilla.org/press/mozilla-2004-06-30.html>
    >
    > BTW: Forget about `embed', that is not Valid HTML either. Use the
    > `object' element from HTML 4.01 instead, supported in the named
    > browsers. Be sure to use its content to provide for an alternative
    > in case it is not supported (I think a visible hyperlink to the used
    > media would suffice.)
    >
    > > So a scriptable Flash movie is the only option (?)

    >
    > It is not. However, depending on the target environment, it is probably
    > the most reliable and fastest option (even though it requires another
    > plugin, the Macromedia Flash Player Plug-in).
    >
    >
    > PointedEars
    >


    OK, I'll see around <object>. Thanks for the help
    Asterbing, Dec 2, 2005
    #5
  6. Asterbing wrote:

    > [Full quote]
    >
    > OK, I'll see around <object>. Thanks for the help


    You are welcome. But please learn how to quote on Usenet.
    Bandwidth, disk space and free time are precious resources.

    <URL:http://jibbering.com/faq/faq_notes/pots1.html#ps1Post>


    PointedEars
    Thomas 'PointedEars' Lahn, Dec 2, 2005
    #6
    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. Pszemus
    Replies:
    0
    Views:
    384
    Pszemus
    Nov 28, 2005
  2. Bob
    Replies:
    24
    Views:
    1,520
  3. Martin Bless
    Replies:
    54
    Views:
    1,035
    David MacQuigg
    Mar 6, 2004
  4. muldoon
    Replies:
    114
    Views:
    2,806
    Dennis Lee Bieber
    Oct 16, 2005
  5. jfancy-Transport Canada

    IE, Opera, Netscape, & Mozilla

    jfancy-Transport Canada, May 31, 2005, in forum: Javascript
    Replies:
    1
    Views:
    114
    Daniel Kirsch
    Jun 1, 2005
Loading...

Share This Page