Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Firefox + QT 7.1.6 javascript Bad NPObject...

Hi,

I'm using QuickTime plugin with Firefox 2.0.0.3 on WinXP and I'm controlling the movie via javascript on a web page. Up to now it's been working well... until the new QuickTime 7.1.6 coming with several security bugfixes and some change that affects the javascript not to work properly. The simple example is that if I have a QuickTime movie between <embed ...</embed> and i use the document.getElementById('movie1').Stop() (or other function) I get a "Bad NPObject as private data!" error. With the 7.1.5 version or earlier it works great.

After searching for hours I haven't find anything to identify the source of the problem...

Any suggestions?

Thanks.


Windows XP Pro

Posted on May 11, 2007 3:41 PM

Reply
11 replies

May 11, 2007 4:39 PM in response to abbath

I really can't see how "stopping" playback via javascript would be considered "private".
The major part of the recent updates excluded javascript calls to "local" files. I read that to mean that only files found on a server (http, rtsp, etc.) could be used.
You can also not control QuickTime via javascript until the browser plug-in has been loaded once.
http://userwww.sfsu.edu/~infoarts/technical/howto/sound/wilson.quicktimejavascri pt.html
That person may offer some help. Javascript is out of my league and I can't get my head around even the basic commands.

May 18, 2007 5:27 AM in response to abbath

Here is a sample html page:
----------
<html>
<head>
<script language="javascript">

function stop()
{
document.getElementById('movie1').Stop();
}

function stopit(mov)
{
mov.Stop();
}

</script>
</head>
<body>

<EMBED width="300" height="300"
src="My.mov"
TYPE="video/quicktime"
PLUGINSPAGE="www.apple.com/quicktime/download"
id="movie1"
name="movie1"
scale="tofit"
enablejavascript="true">
</EMBED>

<!-- method1 -->
<input type="button" value="stop1" onclick="stop()">

<!-- method2 -->
<input type="button" value="stop2" onclick="stopit(document.movie1)">

<!-- method3 -->
Stop3

<!-- method4 -->
Stop4

<!-- method5 -->
Stop5

<!-- method6 -->
Stop6

</body>
</html>
---------

In 7.1.5 plugin all methods work (stop the video), but in 7.1.6 the method 1 and 2 don't work...but why??

May 18, 2007 5:30 AM in response to abbath

Sorry the links is transformed to real links so they looks like:

<!-- method3 -->
<!-- <a href="javascript:stop();">Stop3</a> -->

<!-- method4 -->
<!-- <a href="javascript:stopit(document.movie1);">Stop4</a> -->

<!-- method5 -->
<!-- <a href="javascript:document.movie1.Stop();">Stop5</a> -->

<!-- method6 -->
<!--<a href="javascript:document.getElementById('movie1').Stop();">Stop6</a> -->

Jun 1, 2007 10:40 AM in response to broesel

I am sorry, so far I have not found a solution but...
a "bad" work around for it is: as soon as you know the quicktime embed is not working as it's supposed to, replace the innerHTML of the quicktime container (a div for example) by the html code for the embed object again with the params updated (size, src etc or just the same parameters). this allows you to do one more javascript action on the object before it gets lost again.
if you do it too often then you will crash Firefox, but if it is a simple one time only access needed, then go that road, it works.

good luck, until the quicktime developers get their act together and fix such nonsense

Jun 22, 2007 2:07 AM in response to abbath

Hello,

I'm also having the same problem, has anyone found a solution or more information about this issue?

I found a webpage that has a simple quicktime scripting example where everything works fine:

http://www.onjava.com/onjava/2003/05/14/examples/script-control.html

...but if I download the webpage or try to reproduce the exact same situation on my local machine - I keep getting these "Bad NPObject..." errors. Could this be some kind of problem with the security settings? This is really annoying and I can't find much about it on the web...

Cheers.

Firefox + QT 7.1.6 javascript Bad NPObject...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.