Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Oct 22, 2017 4:10 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How to know whether the video file has played till end?
PostPosted: Mon Aug 27, 2012 8:02 pm 
Offline

Joined: Wed Aug 22, 2012 6:45 pm
Posts: 20
Hi,

How can I verify that the video file has played till its finish, or video file is playing? In VB6 I could know whether the video file has played till end or not by the following code

If mediaplayer1.playState = mediaplayer1psMediaEnded Then


Also, in VB6, following if condition finds whether the video file is playing or not

If mediaplayer1.playState = mediaplayer1psPlaying Then


I would appreciate if some one could share its reabasic equivalent

Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: How to know whether the video file has played till end?
PostPosted: Tue Aug 28, 2012 10:10 pm 
Offline
User avatar

Joined: Fri Jan 12, 2007 10:59 am
Posts: 136
Location: Victoriaville, QC, Canada
The movieplayer has somewhat changed in Real recently. Unless you want to use an external plugin (like MBS), your best solution is to add a boolean property isPlaying.

Create a new class (say, myMoviePlayerClass) with its super set to MoviePlayer
Add a property: isPlaying as boolean
In the Play event, set isPlaying = true.
In the MoviePlayer Stop event, set isPlaying = false.

Might seem like a strange workaround, but the nice thing is you can actually trigger some action by using the "stop" event without having to constantly check if the movie is still playing.

Hope this helps

_________________
Bruno Fr├ęchette
PJJ Productions inc.
RealStudio Web & Desktop on OSX


Top
 Profile  
Reply with quote  
 Post subject: Re: How to know whether the video file has played till end?
PostPosted: Tue Aug 28, 2012 11:19 pm 
Offline

Joined: Wed Aug 22, 2012 6:45 pm
Posts: 20
Bruno,

Are you sure that MBS plug-in has the movieplayer property that tells the video file is complete? Please confirm so that I can ask my supervisor to buy this plug-in for me.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to know whether the video file has played till end?
PostPosted: Wed Aug 29, 2012 3:09 pm 
Offline
User avatar

Joined: Fri Jan 12, 2007 10:59 am
Posts: 136
Location: Victoriaville, QC, Canada
I have the plugin myself. I just tested it and it does work.

Example:
- new project
- place a movie player (MoviePlayer1) in the main window

to open a movie located in your desktop:
MoviePlayer1.Movie = SpecialFolder.Desktop.Child("Assemblee.mov").OpenAsMovieMBS


We have to use the OpenAsMovieMBS method so the movie opens with a handler. Otherwise, the other methods won't work.

To test if the movie has reached the end:
if MoviePlayer1.Movie.IsMovieDoneMBS then msgbox "Done"


To test if the movie is running, test the rate property. 0 means stopped. positive means playing, negative means playing backwards.
if MoviePlayer1.Movie.RateMBS > 0 then
msgBox "Movie is playing!"
elseif MoviePlayer1.Movie.RateMBS < 0 then
msgBox "Movie is playing backwards!"
else
msgBox "Movie is stopped!"
end if


Note that you can download a fully working demo of the plugin to test yourself.

Hope it helps.

_________________
Bruno Fr├ęchette
PJJ Productions inc.
RealStudio Web & Desktop on OSX


Top
 Profile  
Reply with quote  
 Post subject: Re: How to know whether the video file has played till end?
PostPosted: Wed Aug 29, 2012 5:19 pm 
Offline

Joined: Wed Aug 22, 2012 6:45 pm
Posts: 20
Bruno,

Its wonderful. You saved me from creating all those properties.

Thank you and have a nice evening


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group