Re: JavaScript concurrency issues & initialization delay

Kevin DeKorte <[email protected]>
Newsgroups gmane.comp.mozilla.mplayerplug-in
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Forest Bond wrote:
> Hi,
> 
> I am using JavaScript to control the plug-in.  I find that JS locks up pretty
> good when I do things like this:
> 
> setInterval(ChannelNext, 5000);
> 
> ChannelNext changes the mplayer URL and calls Play().  Is it ok to call play
> methods from a separate thread?  The JS console in xulrunner becomes
> unresponsive when I do this.  As you are probably aware, JS doesn't provide a
> non-threaded delay capability, which makes timed loops difficult if the plug-in
> doesn't like threads.
> 
> There is another issue as well.  I am instantiating the plug-in by using
> document.createElement("object") and then filling in the necessary element
> attributes.  As expected, the browser creates a plug-in instance.  However,
> there appears to be a delay between instantiation and the time the plug-in
> becomes usable.  My first call to GetURL() fails because mplayer.GetURL ==
> undefined.  The actual length of time that this is the case appears to be
> somewhat unpredictable, although it has never been very long, although all of my
> media is local.
> 
> Thoughts?
> 
> Thanks,
> Forest

You might want to check the playState variable prior to switching
channels..

As far as calling methods from thread, I don't know if that is supported
or not. I don't know of anything that would prevent it, but threads are
always tricky.

Kevin


- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFG/Qv+6w2kMH0L1dERAnlaAJ4vRnXKvqIzR8l5Ob3iEcJM5DQhYACffsmK
D7e6C8OKaEgdI/c3TH68/64=
=ZAmf
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.