Luis,

The reason I multiplied by 1000 was to make the slider update smoother. Rather than try an explain I have uploaded a real simple 2007r1 project file to the address below. This will work on Mac OSX, because of the horrible problems with quicktime players in rb2007 right now I would not attempt to troubleshoot in windows, it may work (it probably would in rb 5.5.5) but I would not waste the time. There is nothing platform dependent in the code though.

With this code you handle the slider movement during a drag. The slider length can also be updated while the movie is playing by resizing the window. the slider will work in play or pause mode. The reason I left the controller on the window is just because I was to lazy to make a play/pause button. You could easily do this and the eliminate the quicktime controller.

The example requires you have the MBS plugin.

Good luck.

http://drewfindley.com/downloads/rbexamples/Movieplayer_Slider.rbp.zip

-Drew

On Feb 14, 2007, at 7:30 PM, Luis Cordova wrote:

DurationMBS ends up being -1, im looking at the help and it says it
should be a double and i see quicktime use but cannot find the usage
for wmplayer for windows. Also i am opening the movie as OpenAsMovie
rather than OpenAsMovieMBS. Really im getting confused. Hmmm. why the
piece of work just does not work? is there support for duration
without the pluginMBS?

thanks,

luis

On 2/14/07, Luis Cordova <[EMAIL PROTECTED]> wrote:
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: <E18E650F- [EMAIL PROTECTED]><D6BA8A9B-1487-432E-924C-2DF9 [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>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to