I just wanted to add also that the boolean values isPlaying and okToUpdatePosition are set to false and true initially. But still it does not work, I really think it is a problem of movie size and what the ranges of DurationMBS are and what the ranges the slider position is set to.
I have commented the if else lines and just let the video assign the position of the slider and it works but of course it left the slider in the middle before reaching the end. This latter action also disables de dragging of the slider so that the movie responds. hmmm,,, luis On 2/14/07, Luis Cordova <[EMAIL PROTECTED]> wrote:
hi, regarding the email below posted sometime ago I have a question. I did the same thing and solved the problem the other guy asked about an exception because he did not declare the two boolean properties for the window. regarding this portion of code: If Slider1.Maximum <> MoviePlayer2.Movie.DurationMBS*1000 then Slider1.Maximum = MoviePlayer2.Movie.DurationMBS*1000 // set the maximum to the length of the movie (Requires MBS plugin) end if If not okToUpdatePosition then Slider1.Value = MoviePlayer2.Position*1000 //if not dragging slider then movie updates slider end if I think the Slider1.Maximum has a value of 100 as set on the gui which is then set to the length of the movie in milliseconds? why you multiply by 1000? for timecode? What is happening is that the slides freezes, or i think that the position is so low a number that it just stays where it is and does not complete to the end when the movie play to the end. any hint or help? luis To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com> Subject: Re: Slider control controls Movie Player (How) From: Brian Heibert <heibert at verizon dot net> Date: Fri, 26 Jan 2007 01:20:04 -0500 Delivered-to: [EMAIL PROTECTED] Delivered-to: [email protected] References: <[EMAIL PROTECTED]><[EMAIL PROTECTED]> I am using OS X as well On Jan 26, 2007, at 12:59 AM, realbasic at drewfindley dot com wrote: Brian, The way I accomplished this was by no means elegant but seems to work OK. I use this in OSX. Not sure how it works in Win32 yet as I am having lots of trouble getting quicktime players to work in 2007r1. I have an isPlaying boolean property that I set whenever the movie should be playing (do not use the start stop events.) Next I have an okToUpdatePosition boolean that I set whenever the user is moving the slider. Slider must be set to live scroll. Slider1 Mousedown ********************* okToUpdatePosition = true // this prevents the timer from interfering If IsPlaying then MoviePlayer1.Stop //if the movie is playing then stop it end if return true //return true so we can handle the drag ourselves Slider1 Mousedrag ********************* me.Value = ((x-5)/me.Width)*me.Maximum //move the slider to the mouse point (the 5 seems to center it) Slider1 MouseUp ********************* okToUpdatePosition = false //let the timer work again If FullWindow.IsPlaying then MoviePlayer1.Play //if the movie was playing before the change then play it again end if Slider1 ValueChanged ********************* If okToUpdatePosition then MoviePlayer1.Position = slider1.Value/1000 // end if Timer1 - Mode 2 - Runs every 250ms ********************* If Slider1.Maximum <> MoviePlayer1.Movie.DurationMBS*1000 then Slider1.Maximum = MoviePlayer1.Movie.DurationMBS*1000 // set the maximum to the length of the movie (Requires MBS plugin) end if If not okToUpdatePosition then Slider1.Value = MoviePlayer1.Position*1000 //if not dragging slider then movie updates slider end if If anyone else has a better way I would be all ears. -Drew On Jan 25, 2007, at 4:49 PM, Brian Heibert wrote: How can I get a slider control to control the movie player I am building a MP3 Player Brian -- -------------------------------------------------------
-- ------------------------------------------------------- _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
