IE error when trying to use plugin methods

T

torbs

I am trying to use the methods in quicktimes plugin, but IE generetes
an error. I have tried to use the "document.all" instead of
getElementById but the results remain the same. It won't recognise
"movie1" and "movie2" as objects, and it won't allow me to use their
methods.

And of course IE generates an error message that says nothing about
what might be wrong.



Another problem with this code is that I cannot get the lenght of the
movie because it is streamed with rtsp. Any suggestions?

Here is my code:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"
/>
<script language=JavaScript" type="text/javascript">

var movieEnd;
var movieNow;

</script>

<style type="text/css">
<!--

#movie1 {
position:absolute;
top:20px;
left:20px;
visibility:hidden;
}
#movie2 {
position:absolute;
top:20px;
left:20px;
visibility:visible;
}

-->





</style>
</head>
<body>


<form1><OBJECT
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
width="320" height="256" id="movie2"
<PARAM name="src" value="L1M1.mov">
<PARAM name="autostart" value="false">

<EMBED HEIGHT=256 WIDTH=320
SRC="L1M1.mov"

TYPE="video/quicktime"
PLUGINSPAGE="www.apple.com/quicktime/download"

NAME="movie2" autostart="false">
<EMBED />
</OBJECT>

<OBJECT
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
width="320" height="256" id="movie1" >
<PARAM name="src" value="L1M1.mov">
<PARAM name="autostart" value="false">
<EMBED HEIGHT=256 WIDTH=320
SRC="L1M1.mov"
TYPE="video/quicktime"
PLUGINSPAGE="www.apple.com/quicktime/download"

NAME="movie1" autostart="false">
<EMBED />
</OBJECT>
</form1>



<script language=JavaScript" type="text/javascript">
<!--

function changeVisibility(id,action) {
var objId = id;
switch (action) {
case "show":
document.form1.getElementById(''+id+'').style.visibility.toLowerCase()
= "visible";}
case "hide":
document.form1.getElementById(''+id+'').style.visibility.toLowerCase()
= "hidden";

default:return;


}
return;

}


function changePosition(id,x,y) {
document.form1.getElementById(ObjId).style.left = x+"px";
document.form1.getElementById(ObjId).style.top = y+"px";
}



/* define function that calls QuickTime's "Play" method */
function PlayIt(id)
{
if (id=="movie1") {
document.form1.movie1.Play();
} else if (id=="movie2") {
document.form1.movie2.Play();
}

}

/* define function that calls QuickTime's "Stop" method */
function StopIt(anObj)
{
if (id=="movie1") {
document.form1.movie1.Stop();
} else if (id=="movie2") {
document.form1.movie2.Stop();
}

}


function changeIfEnd(id) {
if (id=="movie1") {
while (document.form1.movie1.GetPluginStatus() == "Loading") {}

var movieEnd =document.form1.movie2.GetEndTime();
var movieNow =document.form1.movie2.GetTime();
} else if (id=="movie2") {

while (document.fomr1.movie2.GetPluginStatus() == "Loading") {}


var movieEnd =document.form1.movie2.GetEndTime();
var movieNow =document.form1.movie2.GetTime();
}

timeUntilSwitch = setTimeout("switchMovie()",(movieEnd-movieNow);

}

function switchMovie() {
PlayIt('movie1');
for (var i = 1; i <= 10000; i++) {}
changeVisibility('movie1','show');
changeVisibility('movie2','hide');

}

//-->
</script>



<P style="position:absolute;
top:400px;
left:200px;">
<a href="javascript:playIt('movie2');" onclick="changeIfEnd('movie2');"
PlayIt</a><br>
<a href="javascript:StopIt('movie2');">StopIt</a><br>
</P>

</body>
</html>
 
B

BootNic

torbs said:
I am trying to use the methods in quicktimes plugin, but IE generetes
an error. I have tried to use the "document.all" instead of
getElementById but the results remain the same. It won't recognise
"movie1" and "movie2" as objects, and it won't allow me to use their
methods.

And of course IE generates an error message that says nothing about
what might be wrong.
Another problem with this code is that I cannot get the lenght of the
movie because it is streamed with rtsp. Any suggestions?

Here is my code:
<snip>

line 7 column 1 - Warning: <script> unexpected or duplicate quote mark
line 37 column 1 - Warning: inserting missing 'title' element
line 41 column 1 - Error: <form1> is not recognized!
line 41 column 1 - Warning: discarding unexpected <form1>
line 41 column 8 - Error: <object> missing '>' for end of tag
line 72 column 1 - Warning: discarding unexpected </form1>
line 76 column 2 - Warning: <script> unexpected or duplicate quote mark

Error: syntax error Line: 85
Source Code: case "hide":
Expected '}'

See if any of this info helps

--
BootNic Thursday, October 13, 2005 12:47 PM

Our earth is degenerate in these latter days; bribery and corruption are common; children no longer
obey their parents; and the end of the world is evidently approaching.
*Assyrian clay tablet 2800 B.C.*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top