I am using the Stop() method on a QuickTime movie as a part of a
Lightbox-esque player window. This is all hand-rolled, I am trying to
figure this out as a learning exercise as well as to get it to work.
I have a named function that gets set up in the main page, and then
the click that invokes it is part of the lightbox layer.
The reason why I need the Stop in there is that if you don''t manually
stop the movie from playing before closing the lightbox layer, the
sound continues playing in Safari. Firefox does not have this
problem, properly cleaning up the plug-in when the layer is removed.
var closer = function(){
$(''play_background'').hide();
if(document.qtplayer) document.qtplayer.Stop();
$(''play'').replace(''<div
id="play"><!-- --></div>'');
window.status = '''';
};
//inside the content that updates the "play" container
<p class="center close"><a
href="javascript:closer();" id="close"
title="close">close</a></p>
Firebug reports that Stop is not a function. I can imagine why it
doesn''t think so, because we are inside an anonymous function
already, and the QuickTime stuff was never declared. So how do I get
this to work in this context, with a movie object that does not exist
at the time that the function is declared?
Is this another fine example of where to use bindAsEventListener or
the like? If so, where in the chain does it belong?
My next question is how on earth do you do the close click
unobtrusively with Event.observe -- but I''ll wait to have it all
working first and then plunge into that end of the pool.
Thanks in advance,
Walter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Walter Lee Davis
2007-Jun-09 15:00 UTC
Re: Controlling QuickTime in an anonymous function?
On Jun 9, 2007, at 10:22 AM, Walter Lee Davis wrote:> > I am using the Stop() method on a QuickTime movie as a part of a > Lightbox-esque player window. This is all hand-rolled, I am trying to > figure this out as a learning exercise as well as to get it to work. > [snip]> Firebug reports that Stop is not a function. I can imagine why it > doesn''t think so, because we are inside an anonymous function > already, and the QuickTime stuff was never declared. So how do I get > this to work in this context, with a movie object that does not exist > at the time that the function is declared? >Now this is very weird -- I just quit and restarted Firefox, and it works without complaint -- the first time. If you open the player layer again and try to click "close", then it gives the error. Walter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Walter Lee Davis
2007-Jun-09 15:24 UTC
Re: Controlling QuickTime in an anonymous function?
On Jun 9, 2007, at 11:00 AM, Walter Lee Davis wrote:> > > On Jun 9, 2007, at 10:22 AM, Walter Lee Davis wrote: > >> >> I am using the Stop() method on a QuickTime movie as a part of a >> Lightbox-esque player window. This is all hand-rolled, I am trying to >> figure this out as a learning exercise as well as to get it to work. >> [snip] > >> Firebug reports that Stop is not a function. I can imagine why it >> doesn''t think so, because we are inside an anonymous function >> already, and the QuickTime stuff was never declared. So how do I get >> this to work in this context, with a movie object that does not exist >> at the time that the function is declared? >> > > Now this is very weird -- I just quit and restarted Firefox, and it > works without complaint -- the first time. If you open the player layer > again and try to click "close", then it gives the error. > >Talking to myself here. I figured it out. I needed to define my closer variable/function first, before defining the click handler. Walter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve been doing a lot of javascript quicktime scripting lately, and have noticed it''s really buggy. Like you said, on the same page, it could not be working at all and just refreshing the page or restarting the browser makes it work all the sudden. It''s very werd. On Jun 9, 7:22 am, Walter Lee Davis <w...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> I am using the Stop() method on a QuickTime movie as a part of a > Lightbox-esque player window. This is all hand-rolled, I am trying to > figure this out as a learning exercise as well as to get it to work. > > I have a named function that gets set up in the main page, and then > the click that invokes it is part of the lightbox layer. > > The reason why I need the Stop in there is that if you don''t manually > stop the movie from playing before closing the lightbox layer, the > sound continues playing in Safari. Firefox does not have this > problem, properly cleaning up the plug-in when the layer is removed. > > var closer = function(){ > $(''play_background'').hide(); > if(document.qtplayer) document.qtplayer.Stop(); > $(''play'').replace(''<div id="play"><!-- --></div>''); > window.status = ''''; > > }; > > //inside the content that updates the "play" container > <p class="center close"><a href="javascript:closer();" id="close" > title="close">close</a></p> > > Firebug reports that Stop is not a function. I can imagine why it > doesn''t think so, because we are inside an anonymous function > already, and the QuickTime stuff was never declared. So how do I get > this to work in this context, with a movie object that does not exist > at the time that the function is declared? > > Is this another fine example of where to use bindAsEventListener or > the like? If so, where in the chain does it belong? > > My next question is how on earth do you do the close click > unobtrusively with Event.observe -- but I''ll wait to have it all > working first and then plunge into that end of the pool. > > Thanks in advance, > > Walter--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---