New topic: MoviePlayer - find out if a movie has finished playing
<http://forums.realsoftware.com/viewtopic.php?t=46942> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message Stuart J Sykes Post subject: MoviePlayer - find out if a movie has finished playingPosted: Thu Feb 14, 2013 10:04 am Joined: Fri Oct 26, 2012 6:24 am Posts: 62 I have a movie in my project. Iv'e loaded the .mov file into MoviePlayer1. Can anybody tell me how to code the following.. If movie has finished playing then do this... Top IIGS_User Post subject: Re: MoviePlayer - find out if a movie has finished playingPosted: Thu Feb 14, 2013 10:51 am Joined: Tue Oct 24, 2006 3:38 am Posts: 139 Location: Ger I've no idea how to determine. One of my projects is a player, where I've had hard-coded the length of the movieplayer files. When the length (Timer-driven) is gone, it calls the next file to be played. _________________ This is REALbasic 2011r3 on a MacBook Pro Late '10 ("MacBookPro6,2") with Mac OS X 10.8.2 Top Axel-Erfurt Post subject: Re: MoviePlayer - find out if a movie has finished playingPosted: Thu Feb 14, 2013 3:05 pm Joined: Fri Nov 16, 2012 8:10 pm Posts: 21 Stuart J Sykes wrote:I have a movie in my project. Iv'e loaded the .mov file into MoviePlayer1. Can anybody tell me how to code the following.. If movie has finished playing then do this... if MoviePlayer1.position = MoviePlayer1.duration then // make coffee end Top doofus Post subject: Re: MoviePlayer - find out if a movie has finished playingPosted: Thu Feb 14, 2013 7:13 pm Joined: Thu Sep 10, 2009 2:50 am Posts: 349 Location: Santa Cruz, CA, USA In my mac based movie playing app I have this code in the movieplayers Stop event... if me.Position >= me.Duration - 0.01 then // ReachedEnd end Note the >=, when comparing doubles you sometimes need to allow an error range. Here it'll trip when the player stops within 1/100 second of the end. Exact comparison may work but this is what's working for me. Also, there may be some OS differences in when movieplayer events fire or the value of position at the end. Try logging events and values to see what's going on. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
