openmovie bug? help!
BlitzPlus Forums/BlitzPlus Programming/openmovie bug? help!
| ||
I was using this code to play a movie and it worked for a while, and then suddenly stopped. I am sure the movie is in the same dir as the .bb file. global movie=OpenMovie("movie.mpg") While MoviePlaying(movie) SetBuffer BackBuffer() If KeyHit(1) CloseMovie(movie) End End If DrawMovie(movie,0,0,800,600) Flip Cls Delay(5) Wend CloseMovie(movie) |
| ||
works fine on my Blitz Plus 1.4 if I put this line at the topGraphics 800,600 When you say "It suddenly stopped" do you mean the movie plays a bit and then stops or your code suddently stopped working after running it a few times (meaning you must have a made a change to the code or the file). Is debug mode enabled (on the program menu)? This will tell you if the file is not there as MoviePlaying will error with an invalid handle. |
| ||
Oh yeah, try this more optimised version:Graphics 800,600 Global movie=OpenMovie("movie.mpg") SetBuffer BackBuffer() While MoviePlaying(movie) And KeyHit(1)=0 DrawMovie(movie,0,0,800,600) Flip Wend CloseMovie(movie) It doesn't seem to need the CLS. Please correct me If I am wrong. Why the 5ms Delay command, are you planning to use if with (very fast) animated Gifs? |
| ||
Ok. Here's what goes down. If i run it using graphics 800,600,32,1 at the top it works just peachy. But I want to be able to use any graphics mode. The cls is unneeded if the movie DOES play, but if it doesn't play the proggy does wacky stuff to the graphics that were already there. The CLS makes sure it looks nice even if it crashes. Sort of like adding flowery motif and some opera music to the blue screen of death. |
| ||
What happens if you put the CLS outside of the loop, isn't that OK? You could docls flip cls just to clear both buffers maybe. But I want to be able to use any graphics mode. I am afraid I don't know what to do about this, anyone else? |
| ||
ok. heres what goes down. Openmovie will only play a movie if you specify the color depth of the graphics mode. Hence graphics 800,600 and graphics 800,600,colordepth(),1 do not work You MUST put graphics 800,600,[depth],1 Hopefully they will get rid of this bug soon! |