Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question with embedded media

    Hey is there anyway to delay a media start in the embed tag? I have an mp3 file embedded on a page and I have autostart set to true. The problem is the song starts up so fast that it is glitchy for the first, say, 5 seconds while the song buffers. If there is a way to set it to wait an alloted amount of time before the song starts to avoid the glitchyness that would be awesome !

    I am using a very simple media player code that looks like this:

    Code:
    <embed allowScriptAccess="never" SRC="__URL__" AUTOSTART=false WIDTH=144 HEIGHT=60 LOOP=true>
    Any help is appreciated, thanks !!!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I'm not even sure if this will work. HTML isn't made for preloading songs. Flash can do this though.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    function delayStart()
    {
    	document.getElementById('music').innerHTML = '<embed allowScriptAccess="never" src="__URL__" autostart="1" width="144" height="60" loop="true"></embed>';
    }
    setTimeout("delayStart()",5000);
    </script>
    </head>
    
    <body>
    <div id="music"><embed allowScriptAccess="never" src="__URL__" autostart="0" width="144" height="60" loop="true"></embed></div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •