Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

delay start of avi

Posted on 2004-09-09
2
Medium Priority
?
216 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 375 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

670 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