Isn't it amazing that Adobe/MM never bothered setting up a simple
onStopMovie event?...

> -----Original Message-----
> From: Hans Wichman [mailto:[EMAIL PROTECTED] 
> Sent: 18 January 2007 12:12
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] how to know that thae video is finished?
> 
> Hi,
> the video might not be correctly encoded, ie from meta data 
> etc. And I think that in some player version (might still be 
> the case), the stop is triggered before the buffer empty. In 
> other words if you have a buffer set to 5 seconds, the video 
> will play on for 5 seconds after receiving a stop signal.
> 
> In the end we preprocessed all our vids with a 
> metadatainjector such as burak's and check the time against 
> the duration.
> 
> greetz
> JC
> 
> 
> 
> On 1/18/07, Karina Steffens <[EMAIL PROTECTED]> wrote:
> >
> >
> > Privyet Natasha,
> >
> > Here's how I solved it:
> >
> > Private var movie_flv:mx.controls.MediaDisplay;
> > private var t:Number;
> > private var lastCheck:Number;
> > Private var play_btn   //ToggleButton
> > ....
> >
> > Private function checkStatus(){
> >        if (play_btn.selected && movie_flv.playheadTime && 
> > movie_flv.playheadTime == lastCheck){
> >                stopMovie()
> >        }else{
> >                lastCheck = movie_flv.playheadTime;
> >        }
> > }
> >
> > public function stopMovie(){
> >        //This is where you execute you stop movie code, sent from 
> > checkStatus or remotely
> >        clearInterval(t)
> >        play_btn.selected = false;
> >        movie_flv.stop()
> >        lastCheck = 0;
> >      //Etc...
> > }
> >
> > //And when you start playing:
> > t = setInterval(this, "checkStatus", 2000)
> >
> >
> > ----------
> >
> >
> > And  of course, this code can modified to suit your needs. You can 
> > also replace the setInterval with onEnterFrame=checkStatus;  and 
> > delete enterFrame; in the stopMovie() handler or equivalent.  The 
> > play_btn in my code refers to a custom ToggleButton that switches 
> > between
> > playing(selected) and paused(deselected) states. You might still be 
> > able to use that check with a different toggle button control, or 
> > alternatively, set a flag variable to check if the movie is 
> currently 
> > paused.
> >
> > Hope this helps,
> >
> > Karina
> >
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: natalia Vikhtinskaya [mailto:[EMAIL PROTECTED]
> > > Sent: 18 January 2007 10:00
> > > To: Flashcoders mailing list
> > > Subject: Re: [Flashcoders] how to know that thae video is 
> finished?
> > >
> > > Thank you very much for help. I used this for two different flv 
> > > videos.Ichecked status for both:
> > > For one I have this trace
> > >
> > > NetStream.Play.Start
> > >
> > > NetStream.Buffer.Full
> > >
> > > NetStream.Buffer.Flush
> > > NetStream.Buffer.Empty
> > >
> > > and for another
> > >
> > > NetStream.Play.Start
> > >
> > > NetStream.Buffer.Full
> > >
> > > NetStream.Buffer.Flush
> > >
> > > NetStream.Play.Stop
> > >
> > >
> > >
> > > I am not big expert in video. Can anybody explain why one 
> video has 
> > > status NetStream.Play.Stop and another not? And how to 
> write script 
> > > that find that video is finished for any video.
> > >
> > >
> > >
> > > 2007/1/18, Matthias Dittgen <[EMAIL PROTECTED]>:
> > > >
> > > > use this:
> > > >
> > > > myNetStream.onStatus = function(infoObject:Object):Void {
> > > >        if (debug==true)
> > > >        {
> > > >        status_txt.text += "status (" + this.time + " 
> seconds)\n";
> > > >        status_txt.text += "\t Level: " + 
> infoObject.level + "\n";
> > > >        status_txt.text += "\t Code: " + infoObject.code 
> + "\n\n";
> > > >        }
> > > >        if (infoObject.code=="NetStream.Play.Stop")
> > > >        {
> > > >                // VIDEO FINISHED..
> > > >                // use some Delegate.create(...) here
> > > >        }
> > > > }
> > > >
> > > > HTH,
> > > > Matthias
> > > > _______________________________________________
> > > > Flashcoders@chattyfig.figleaf.com
> > > > To change your subscription options or search the archive:
> > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > > >
> > > > Brought to you by Fig Leaf Software Premier Authorized Adobe 
> > > > Consulting and Training http://www.figleaf.com 
> > > > http://training.figleaf.com
> > > >
> > > _______________________________________________
> > > Flashcoders@chattyfig.figleaf.com
> > > To change your subscription options or search the archive:
> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >
> > > Brought to you by Fig Leaf Software
> > > Premier Authorized Adobe Consulting and Training 
> > > http://www.figleaf.com http://training.figleaf.com
> > >
> >
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training 
> > http://www.figleaf.com http://training.figleaf.com
> >
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training 
> http://www.figleaf.com http://training.figleaf.com
> 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to