Thanks, Ryan!

William Yu kindly provided me with this workaround that utilizes the ActiveX
API that MoviePlayer uses for Windows Media Player --

MoviePlayer1.MovieController.CurrentMedia.Duration

Make sure your movie is already loaded into the MoviePlayer.Movie before
calling that line of code.  At least that's a lot easier than having to use
an OLEContainer control.  Hope that helps you like it did me...  :-)

--Dave



> I have found that it is easier to use the OLEContainer/ActiveX version
> of the Windows Media Player control.  When you do that, you get access
> to all the properties, events and methods of the actual Media Player.
> 
> But to answer the question specifically, no I don't know the declares,
> but the ActiveX methods are quite straight-forward.
> 
> - Ryan
> 
> Dave Wooldridge wrote:
>> Erick and Joe,
>> 
>> THANKS, but I already have a solution to get the Duration for QT movies.
>> What I was looking for is how to get the read-only movie's Duration if the
>> MoviePlayer.PlayerType is set to Windows Media Player.
>> 
>> In my original Feature Request, I wrote:
>> 
>> 
>>> The MBS plugin has the DurationMBS property,
>>> but that only works for QuickTime-supported
>>> Read-Only files, leaving the problem unresolved
>>> if the MoviePlayer is set to PlayerType=2
>>> (Windows Media Player).
>> 
>> 
>> 
>> Do either of you have any Duration declares that would work for Windows
>> Media Player when used with the MoviePlayer control?
>> 
>> Regards,
>> Dave Wooldridge
>> Electric Butterfly
>> http://www.ebutterfly.com
>> 
>> 
>> ------------------------------------
>> 
>> 
>> 
>>> On Mar 14, 2006, at 6:50 PM, Dave Wooldridge wrote:
>>> 
>>>> Even though a movie's Duration can be obtained via an Editable
>>>> Movie, that
>>>> only works for writeable movies. When accessing a Read-Only movie
>>>> (such as
>>>> on CD), there's currently no way to get the Duration from the
>>>> MoviePlayer.Movie.
>>> 
>>> While I agree that it might be nice to have this built-in,  you can
>>> easily find the information yourself *today*. :-)
>>> 
>>> Here's some code (MachO required for this snippet, but it should work
>>> fine on all other QT-able RB platforms)
>>> 
>>> hth,
>>> Erick
>>> 
>>> -------------------------------
>>> 
>>> 
>>> dim f as folderitem
>>> dim m as movie
>>> Dim i,n as Integer
>>> 
>>> Declare Function GetMovieDuration  Lib "/System/Library/Frameworks/
>>> QuickTime.framework/QuickTime" _
>>>     (movie as integer) as integer
>>> 
>>> Declare Function GetMovieTimeScale  Lib "/System/Library/
>>> Frameworks/QuickTime.framework/QuickTime" _
>>>     (movie as integer) as integer
>>> 
>>> f = GetOpenFolderItem("any")
>>> if f<>nil then
>>>   m = f.openasmovie
>>>   i = GetMovieDuration(m.handle)
>>>   n = GetMovieTimeScale(m.handle)
>>>   MsgBox "GetMovieDuration = "+str(i)+" TimeScale units"+chr(13)
>>> +"GetMovieTimeScale="+str(n)+chr(13)+"wristwatch time = "+str(i/n)+"
>>> sec."
>>> end if
>>> 
>>> 
>> 

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to