Sunday, August 2, 2009

HTML help! How can i delay loading a file in my HTML coding?

I'm making a website, which has one MP3 file that has to be loaded. since the file is about 3MB some users have difficulty to open the webpage. I want to delay opening that mp3 ,after the whole page has been loaded.


what's the code to delay opening a file?

HTML help! How can i delay loading a file in my HTML coding?
Here is an example of how to do it:








%26lt;html%26gt;


%26lt;script%26gt;


function loadPlayer() {


Player.URL = "myMP3.mp3"


Player.controls.play()


}


%26lt;/script%26gt;





%26lt;body onload="loadPlayer();"%26gt;





%26lt;object id="Player" classid="CLSID:6BF52A52-394A-11d3-B153-0...


width="0" height="0"%26gt;


%26lt;/object%26gt;








%26lt;/body%26gt;


%26lt;/html%26gt;
Reply:Use coffecup.com 's firestarter. with it - make a blank movie and insert the mp3 - choose the amount of dely by adjusting the slider. real easy that way. save as an .swf (flash) no coding needed
Reply:Maybe you can use a frameset and load the mp3 in a separate frame. Or maybe even using iframes -- or using JavaScript to dynamically create the element and load the mp3 after your page has been rendered.
Reply:You need to use a streaming script. This loads the file a little at a time while playing what has already been loaded.





LIke this:





%26lt;object ID="WMPlay" width="169" height="61" classid="CLSID:6BF52A52-394A-11d3-B153-0... codebase="http://activex.microsoft.com/a... standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" style="border: 1px solid #000000; margin-top: 0; margin-bottom: 0; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center


"%26gt;


%26lt;param name="URL" value="http://www.yoursite.com/yourfile.... type=".mp3" ref%26gt;


%26lt;param NAME="AutoStart" value="-1"%26gt;


%26lt;param NAME="InvokeURLS" value="0"%26gt;


%26lt;param name="rate" value="1"%26gt;


%26lt;param name="balance" value="0"%26gt;


%26lt;param name="currentPosition" value="0"%26gt;


%26lt;param name="defaultFrame" value%26gt;


%26lt;param name="playCount" value="1"%26gt;


%26lt;param name="currentMarker" value="0"%26gt;


%26lt;param name="baseURL" value%26gt;


%26lt;param name="volume" value="100"%26gt;


%26lt;param name="mute" value="0"%26gt;


%26lt;param name="uiMode" value="mini"%26gt;


%26lt;param name="stretchToFit" value="0"%26gt;


%26lt;param name="windowlessVideo" value="0"%26gt;


%26lt;param name="enabled" value="-1"%26gt;


%26lt;param name="enableContextMenu" value="-1"%26gt;


%26lt;param name="fullScreen" value="0"%26gt;


%26lt;param name="SAMIStyle" value%26gt;


%26lt;param name="SAMILang" value%26gt;


%26lt;param name="SAMIFilename" value%26gt;


%26lt;param name="captioningID" value%26gt;


%26lt;param name="enableErrorDialogs" value="0"%26gt;


%26lt;param name="_cx" value="4471"%26gt;


%26lt;param name="_cy" value="1614"%26gt;


%26lt;embed width="320" height="312" type="application/x-mplayer2"


pluginspage="http://www.microsoft.com/...


src="stream_asx.html?speed=300%26amp;path=au... Name="GameSpot Live" ShowControls="1" AutoStart=True ShowDisplay="0" ShowStatusBar="1"%26gt;


%26lt;/embed%26gt;%26lt;/object%26gt;

playing cards

No comments:

Post a Comment