Solved

delay start of avi

Posted on 2004-09-09
2
207 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

820 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