Quicktime and JS - what am I missing?

B

Binba

I created the simplest embed QT movie page, and for starters, want to
get the version. An HREF event works fine, but otherwise I get a
fabulous "Unspecified error".
I'm using MSIE6 WinXP SP2.

<html>
<body>
<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="test.mov">
<EMBED HEIGHT=256 WIDTH=320
SRC="test.mov" TYPE="video/quicktime"
PLUGINSPAGE="www.apple.com/quicktime/download"
EnableJavaScript="true" NAME="movie1">
</OBJECT>

//works:
<a href="javascript:alert
(document.movie1.GetQuickTimeVersion());">version</a>

//doesn't:
<script language="JavaScript">
<!--
alert (document.movie1.GetQuickTimeVersion());
// -->
</script>

</body>
</html>

Am I missing something really basic here?

Thanks.
 
R

RobG

I created the simplest embed QT movie page, and for starters, want to
get the version. An HREF event works fine, but otherwise I get a
fabulous "Unspecified error".
I'm using MSIE6 WinXP SP2.

<html>
<body>
<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="test.mov">
<EMBED HEIGHT=256 WIDTH=320
SRC="test.mov" TYPE="video/quicktime"
PLUGINSPAGE="www.apple.com/quicktime/download"
EnableJavaScript="true" NAME="movie1">
</OBJECT>

//works:
<a href="javascript:alert
(document.movie1.GetQuickTimeVersion());">version</a>

Assuming that movie1 is an object and that GetQuickTimeVersion is
necessarily a mehthod supported by that object seems a little error
prone. Try:

var movie = document.movie1;
if (movie && tyepof movie.GetQuickTimeVersion == 'function') {
alert( movie.GetQuickTimeVersion() )
} else {
// Either movie1 isn't an element in one of the standard
collections
// or it doesn't have a GetQuickTimeVersion method
}

That should also check whether the QuickTime plugin is installed. I
can't test it right now since I don't have (or want) QuickTime on my
Windows machine. I can test it later on a Mac if you want.
//doesn't:
<script language="JavaScript">
<!--

The language attribute is deprecated, type is required. There is no
point to HTML comments inside script elements, just don't use them.

<script type="text/javscript">


To be strictly standards compliant you should be using
type="application/javascript" but it will cause your scripts to fail
in at least some browsers. Some suggest ignoring validation errors
and using:

<script> ... </script>
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top