Solved

delay start of avi

Posted on 2004-09-09
2
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

630 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