Solved

delay start of avi

Posted on 2004-09-09
2
203 Views
Last Modified: 2008-02-20
I need to be able to delay the start of an avi to allow other events to occur.  I have created and used the following script, but there is a black flash between the gif and the avi.

<html>
<head>
<title>Test</title>
<script language="JavaScript">
<!--
  image1 = new Image();
  image1.src = "images/vcr1.gif";
  image2 = new Image();
  image2.src = "video/tapein.avi";

  function picture1()
  {
    window.document.form.dynsrc=image1.src;
    window.setTimeout('picture2()',5000);
  }
  function picture2()
  {
    window.document.form.dynsrc=image2.src;
  }
//-->
</script>
<body onLoad="window.setTimeout('picture2()',10000)">
<div align="center">
<h1>Test</h1>
<p>
<image name="form" dynsrc="images/vcr1.gif" start="fileopen"> </a> </div> </body> </html>

I know this isn't the best solution.
0
Comment
Question by:jern50
2 Comments
 
LVL 1

Expert Comment

by:Aramysm
ID: 12022805
why not simply call the function after the other events have occurred as opposed to setTimeout().  As for the flash between the gif and the AVI I'm guessing that is because you are switching formats so apbruptly if you want it to happen immediately I'd suggest either converting the clip into flash or converting the AVI into .gif format  I know this perhaps isn't the best solution perhaps the .gif into AVI and simply join the videos with the desired delay between the two things.
0
 
LVL 13

Accepted Solution

by:
davidlars99 earned 125 total points
ID: 12036762
you can check if audio file was loaded like this

  image1 = new Image();
  image1.src = "images/vcr1.gif";
  image2 = new Image();
  image2.src = "video/tapein.avi";

  if(image2.complete)
       ........
       


if(document.getElementById("audio").ReadyState==4)
    document.getElementById("snd"+current).play()




but you have to load it this way inside the body content



<object id="audio" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
   <param name="FileName"  value="file3.avi">
   <param name="AutoStart"                 value="false">
   <param name="SendPlayStateChangeEvents" value="true">
   <param name="ShowAudioControls"         value="false">
</object>


0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now