Changeset 14041 for trunk/FACT++/www


Ignore:
Timestamp:
06/02/12 20:29:40 (12 years ago)
Author:
tbretz
Message:
Some more improvements to the audio and some little traffic improvements
Location:
trunk/FACT++/www/smartfact
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/smartfact/index.css

    r14040 r14041  
    221221h3 {
    222222        margin:0;
     223        color:#206;
    223224}
    224225
     
    226227        margin:0;
    227228        color:#206;
     229}
     230
     231.astro {
     232        width:100%;
    228233}
    229234
  • trunk/FACT++/www/smartfact/index.html

    r13686 r14041  
    44<head>
    55  <title>SmartFACT++</title>
    6   <script type="text/javascript" src="index.js"></script>
     6  <script src="index.js"></script>
    77  <link rel="stylesheet" type="text/css" href="index.css" />
    8   <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
     8  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=0, minimum-scale=1, maximum-scale=1, target-densitydpi=device-dpi" />
    99</head>
    1010
    11 <body id="body" onload="onload();" onresize="onresize();"/>
     11<body id="body" onload="onload();" onresize="onresize();">
     12<audio autoplay id="audio">
     13  <source type="audio/mp3"/>
     14  <source type="audio/ogg"/>
     15</audio>
     16</body>
    1217</html>
  • trunk/FACT++/www/smartfact/index.js

    r14031 r14041  
    6464
    6565    $("audio").date = new Date();
    66 
    6766
    6867    /*
     
    672671    table.appendChild(tf);
    673672
    674     // ==================================================================
    675     /*
    676     var audio = $new("AUDIO");
    677 
    678     audio.autoplay = true;
    679     audio.date     = new Date();
    680     audio.id       = "audio"+z;
    681 
    682     var ogg = $new("SOURCE");
    683     var mp3 = $new("SOURCE");
    684     audio.appendChild(ogg);
    685     audio.appendChild(mp3);
    686 
    687     $("body").appendChild(audio);
    688     */
    689 
    690673    $("body").appendChild(table);
    691674
     
    978961        // Time stamp of audio file must be newer than page load
    979962        //  or last audio play respecitvely
    980         if (audio_date>audio.date)
    981         {
     963        if (audio_date>audio.date && header[2].length>0)
     964        {
     965            var name = "audio/"+header[2];
     966
     967            var mp3 = $new("SOURCE");
     968            var ogg = $new("SOURCE");
     969            mp3.src = name+".mp3";
     970            ogg.src = name+".ogg";
     971
     972            // If audio file has changed play the new one
     973            if (audio.firstChild.src!=mp3.src)
     974            {
     975                audio.replaceChild(mp3, audio.firstChild);
     976                audio.replaceChild(ogg, audio.lastChild);
     977
     978            }
     979
    982980            audio.date = audio_date;
    983981
    984             var name_ogg = "audio/"+header[2]+".ogg";
    985             var name_mp3 = "audio/"+header[2]+".mp3";
    986 
    987             var ogg = $new("SOURCE");
    988             var mp3 = $new("SOURCE");
    989             ogg.type = "audio/ogg";
    990             mp3.type = "audio/mp3";
    991             ogg.src  = name_ogg;
    992             mp3.src  = name_mp3;
    993 
    994             if (audio.firstChild.src!=ogg.src)
    995             {
    996                 audio.replaceChild(ogg, audio.firstChild);
    997                 audio.replaceChild(mp3, audio.lastChild);
    998             }
     982            /*
     983             audio.firstChild.src = name_mp3;
     984             audio.lastChild.src  = name_ogg;
     985             audio.load();
     986             */
    999987        }
    1000988    }
Note: See TracChangeset for help on using the changeset viewer.