ESC-problem with movieplayer

Blitz3D Forums/Blitz3D Programming/ESC-problem with movieplayer

PowerPC603(Posted 2003) [#1]
Hi,

I created a small and simple movieplayer.
You can download it here:
http://users.pandora.be/vge/downloads

On my PC (Intel P4 with WinXP Professional) it works like it should.

But my friend has Windows 2000 Advanced Server.
When he presses the ESC-key, the movie doesn't quit, and the pc just makes a beep-sound.
He has to wait until the movie actually ends.

Even stranger: after playing a movie, the CTRL-ALT-DEL keycombination doesn't work anymore.
Any key pressed results in a beep-sound, only the mouse works normally.

The source code is also located at my website.
Could someone look at the code and tell me how I could fix this?
Maybe using a different main loop?

I currently using this loop:

Repeat
; some code
Until KeyHit(1) Or MoviePlaying(movie)=False


Should I use this code:

While NOT KeyHit(1) or MoviePlaying(movie)=False
; some code
Wend


Or does this make no difference?

For anyone who has looked on my website:
MoviePlayer.exe uses the first loop, MoviePlayer2.exe uses the second loop. They do exactly the same on my pc.

If the movieplayer works for you, you can use it freely.
You can even take screenshots (press F8) with it from a playing movie (that's the reason I designed it).
The screenshots will be stored in this location:
"C:\MoviePlayer\Screenshots"
I don't know what error you will get when this directory isn't present.

You will not be able to pause the movie or to move forward or backward in the movie.
Even the soundvolume isn't changable.
I don't know how to do this (if it is even possible).


jfk EO-11110(Posted 2003) [#2]
sounds pretty much like the keyboard buffer was filled with keystrokes.
I don't know what's the problem, but I would reccomend to use the keydown(1) function instead.

while not keydown(1)...
...
wend
and then at the end:
flushkeys()

If this doesn't work then this is one for the bug reports.

BTW you really should use Flip true or at least Delay 1 in the Loop because if you don't then windows cannot "breath".
Or, assuming the Movie should play with 30 Frames per Second you could also use the CreateTimer and Waittimer Functions:

fps=30
t=createtimer(1000/fps)

while not keydown(1)...
drawmovie movie
waittimer t
Flip 0
wend


PowerPC603(Posted 2003) [#3]
According the explanation in the help-files, the DrawMovie command doesn't need an extra timer for timing AVI-movies.
The timer commands are only needed for animated GIFs, because they have no internal timing info.

The movies I tried all play back at normal speeds.

The problem is actually when my friend presses the ESC-key, his computer doesn't end the movie, it just makes a beep-sound, while my pc does exactly what it must do (terminating the movie).

I don't know if this is related to Windows2000 Advanced Server, or to Blitz3D.
If anyone who uses Win2000 Advanced Server could try this program. To use the player, you have to set it as the default player for a specific filetype in Windows.
Otherwise the player will display a message, informing you that no valid file is supplied to the player.
(It needs the filename and full path in it's command-line)

We will try this "FlushKeys()" command, to see if that helps.
In this case, I think KeyHit and KeyDown would perform the same action: Terminating the movieplayer.

Keydown is (according to the manuals) used when the user has to HOLD a key down, so the action assigned to the key is executed every time the main-loop executes for as long the key is being pressed.
This isn't the case here, because the main-loop would be interrupted as soon as the ESC-key is being pressed.
So keeping checking it, to see if it is HELD down, is actually unneccessary.

But it could be worth trying it if nothing else helps.