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:
> I think it might just be a bug. I've attached the logfile.
>
> It's definitely not releated to setTimeout, because I hit the same issue with or
> without that call. What's interesting is that I can make the problem go away by
> placing an alert(...) call after calling Stop(). I don't know why that would
> be.
>
> My code is doing something like this:
>
> --------------------------------------------------------------------------------
> if(mplayer.isplaying()) {
> mplayer.Stop();
> while(mplayer.playState != 1) {
> ;
> }
> }
> //alert('after Stop: ' + mplayer.playState);
>
> mplayer.Open(new_url);
>
> mplayer.Play();
> while(mplayer.playState != 3) {
> ;
> }
> --------------------------------------------------------------------------------
>
> As I mentioned above, uncommenting that alert(...) call makes the problem go
> away. Very strange.
>
> What do you think?
>
> -Forest
I agree that it is really odd.. have you tried putting a "sleep" inside
the while loop? I'm not sure if javascript has that or not, but if so
then maybe there and then maybe one more after the loop is done. I think
100usec should be enough.
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/SMi6w2kMH0L1dERAopvAJ9s2FAXdEFaWal2GHlz8/qVNasGBwCcChmv
ZLJgzJYi1xJ+3+ZHTiSDp8g=
=nuFo
-----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/