Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TmediaPlayer Not Notifying Right

61 views
Skip to first unread message

Don Pearsall

unread,
Jun 18, 1999, 3:00:00 AM6/18/99
to
I have an app that uses TMediaPlayer to run AVI's. Although I have set the
notify property to true after each notify event, if does not reliably notify
when the AVI has stopped. Sometimes it does it right, sometimes it doesn't.

For instance many times it will activate the notify event when the avi has
stopped, but the Mode property will be set to "playing". And just as many
times the mode will be set to "stopped". It does all this with no pattern I
can tell.

Any ideas?

Thanks,
Don Pearsall

Steve Bliss

unread,
Jun 19, 1999, 3:00:00 AM6/19/99
to
There are several issues here the first may be the way you are using the
Notify property. It must be set to true just before the method to play
or stop etc., NOT from inside the event handler. The other is that
sometimes the event will fire as the movie starts, this seems to be a
bug that I am yet to find an answer to, because it also prevent the
event from firing when the movie has actually stopped. I have no idea
if this is a TMediaPlayer or MCI bug.

Another problem is that the MCI interface used by the TMediaPlayer is
terrible at reflecting it's true state (not Delphi's fault, M$'s MCI is
the problem here). For instance you may tell the player to play a CD,
then display the current time into the track when the Mode is mpPlaying
.. sounds logical ? Well you have to wait a bit because for the first
1/2 sec or so you will get garbage data for the Position property. This
is also typical of some multimedia VB controls, and to me reflects the
general poor quality of anything M$ and it's partners do. I also think
that VB programmers age faster too <g>

... anyway, I would suggest that you import the AcvtiveMovie (AMovie.OCX
in \Windows\System), or the Windows Media Player (MMefxe.OCX I think ?)
OCX control into Delphi and use it instead. It is a bit more work to
use, but much more reliable. If you have Windows media player on a
system there will still be an ActiveMovie OCX there for backward
compatibility, but it will use the newer DirectShow part of the Windows
Media Player. The reversse is not true, but may be better (more
stable).

If you have never importated an OCX into Delphi, then simpley select
import ActiveX from the Components menu, could not be easier. Once done
you will find it in the ActiveX tab of the components palette.

Maybe someone from TeamB may know why Notify can fire at the start and
not end of a video in TMediaPlayer ? ... I sure don't.

Steve Bliss

0 new messages