on 2/15/07 6:53 AM, 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, great hint that of OpenEditableMovie, however, now when i run
> the example of the slider it follows the slider however, the video
> play button shows up frozen/disabled when i use windows media player,
> everything works good when i use quicktime player. In both cases the
> slider when dragged with the mouse restart the movie from the
> beginning,


When setting the PlayerType to 2 (Windows Media Player), many of the
properties that are QuickTime-compatible or available through the
QuickTime-only MBS functions won't work for Windows Media Player.

What you have to do is access those properties through the Windows Media
Player API.  On Windows, the MoviePlayer control is merely a wrapper for the
actual Windows Media Player functionality.  Check out Microsoft's API
reference online for the WMP Object Model:

<http://msdn2.microsoft.com/en-us/library/aa393405.aspx>

For example, to access the Duration with Windows Media Player in the
MoviePlayer control, you could use the following code (if your control is
named MoviePlayer1 -AND- your movie has already been loaded into the
MoviePlayer1.Movie property (very important):

Dim dur As Double
dur = MoviePlayer1.MovieController.CurrentMedia.Duration

Here's the big catch though...

Until the Windows Media Player has finished loading the movie into memory
(which can take a couple seconds depending on the size of your movie), the
Duration property will always return 0.  In order for Windows Media Player
to properly load the movie, you have to begin playback by calling the Play
event.

Obviously, now that the movie has started to play, you're a little stuck
because you do not yet have a valid Duration property for your Slider's
maximum value.

To workaround this problem, I load the movie into the Movie property, call
the Play event, and test to see if the Duration = 0.  If it does, then I
pop-up a progress bar that tells the user that the movie is being loaded.
While the progress bar modal dialog is displayed, I keep checking the
Duration property.  When the Duration property is finally not equal to 0,
then I remove the progress bar and configure the Slider with the Duration as
the maximum value, adjust the Slider position to the movie's current
position and continue playing.  Its not a perfect solution, but until the
problem is fixed, its a viable workaround that works.

Hope that helps...

Regards,
Dave Wooldridge
Electric Butterfly
http://www.ebutterfly.com

-------------------------------------



_______________________________________________
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