Visualizzazione dei risultati da 1 a 2 su 2

Discussione: gestione audio

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    217

    gestione audio

    ciao ragazzi ho scaricato uno script dalle dedeme dhtml http://www.html.it/dynamic/utility/utility01.htm ma nn funge ne aonline ne in locale, ho provato a cercare il problema ma nn sono il massimo nella programmazione.
    Chi mi da una manina ?






    <HTML>
    <HEAD>

    <!-- Codice scaricato gratuitamente da HTML.it, il sito italiano sul Web publishing
    http://www.html.it -->

    <TITLE>Demo Dynamic HTML: esempio pratico </TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    n = (document.layers) ? 1:0
    ie = (document.all) ? 1:0
    // also works for Netscape 3, I set the n value to 3 to tell the difference
    // between Netscape 4 (n=1) and Netscape 3 (n=3)
    if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 3) {n=2;ie=0}

    // initially set sound off
    soundenabled = 0

    function playAudio(song) {
    // only play if sound is enabled
    if (soundenabled) {
    // must stop the song before playing another one (for IE)
    stopAudio()
    // play the desired song
    if (n>=1) {
    if (song==1) document.musica1.play(true) // loop the midi file
    if (song==2) document.musica2.play(true)
    }
    if (ie) {
    if (song==1) document.musica1.run()
    if (song==2) document.musica2.run()
    }
    }
    }

    function stopAudio() {
    // only stop if sound is enabled
    if (soundenabled) {
    // stop playing all the songs
    document.musica1.stop()
    document.musica2.stop()
    }
    }

    //-->
    </SCRIPT>

    </HEAD>

    <BODY bgcolor="white" >



    <!--
    Warning: you have to execute the functions using
    HREF="#" onClick="functionName()" or it won't work in IE 4
    -->



    Un po' di Reggae...

    ... o un po' di pulp

    stop

    <!--
    If you are using Netscape 4.0 to view this source you will not see the
    JavaScript that writes out these EMBED tags
    -->

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    // dynamically write the embed tag only if Netscape has a midi component, you
    // can change that to audio/x-wav if you want to play wav files etc.
    // IE4 has sound by default so you only need to check if they are using IE 4
    if ((n>=1 && navigator.mimeTypes["audio/x-midi"]) || ie) {
    soundenabled = 1
    document.write("<EMBED NAME='musica1' SRC='musica1.mid' LOOP=TRUE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>")
    document.write("\n<EMBED NAME='musica2' SRC='musica2.mid' LOOP=TRUE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>")
    }
    // if the browser doesn't have midi-capabilities go download the component for N4 or go to the Netscape download page
    else {
    soundenabled = 0
    if (n==1) { // if Netscape 4
    if (confirm("To listen to the music on this page you must download the\nmultimedia component to Netscape Communicator\n\nDo you want to install it now?")) {
    alert("On the following page, download the multimedia component (mm.jar) for your operating system.\nWhen you are done, reload this page to hear the music")
    location = "ftp://ftp.netscape.com/pub/communicator/smartupdate/index.html"
    }
    }
    else { // if anything else
    if (confirm("You do not have a midi compatible browser, do you want\n to download Netscape Communicator now?"))
    location = "http://home.netscape.com/download/"
    }
    }

    //-->
    </SCRIPT>


    </body>
    </html>

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    217

    ho trovato anke questo

    ciao ragazzi, ne ho trovato un'altro che funziona

    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Content-Language" content="it">
    <title>Home page</title>
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    </head>

    <script>


    musi="musica1.mid"

    function mus1()
    {
    if (t.options.selectedIndex==0){
    mus.innerHTML="<embed src="+musi+" loop=-1>"
    }
    if (t.options.selectedIndex==1){
    mus.innerHTML=""
    }
    }
    document.write("<span id='mus' style='position:absolute;top:-90000'><embed src="+musi+" width=0 height=0 loop=-1></span>")
    </script>
    <body>
    <select name="t" onchange=mus1()>
    <option>Enable background music
    <option>Disable background music
    </select>

    </body>

    </html>
    -------------------------

    però a me servirebbe di gestire la riproduzione o lo stop tramite link come tersto o immagini... io ci ho provato ma nn riesco ad atrribuire i comandi..
    Dai per piacere datemi una manina.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.