Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

How to know if MediaPlayer opened or closed the file?

Hello guys,

I use the component MediaPlayer and I'd like to know if my mediaplayer opened and is ready to play a file, is there a way to know about? Or if it closed the file that it was playing.

I tried to use this without opening any file to know it my mediaplayer is close or without any file ready to play.

  if MediaPlayer1.Mode = mpNotReady Then
  Begin
    ShowMessage('Not ready');
  End;

But it seems that this mpNotReady doesn't work as it should.


Thanks
Alex
0
hidrau
Asked:
hidrau
  • 4
  • 4
1 Solution
 
MerijnBSr. Software EngineerCommented:
To be honest, I've stopped using TMediaPlayer long ago because I kept running into small annoying things. What is it you are trying to play?
0
 
hidrauAuthor Commented:
hummm,

What are you using now ?

My problem is to know if my mediaplayer is ready to play a file.

If I don't pass a file name to it and open it, it is in some ""state"" that I don't know, I need to get this state,

did you get it?
0
 
MerijnBSr. Software EngineerCommented:
What kind of file are you playing, audio, video, etc?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
hidrauAuthor Commented:
Audio file
0
 
MerijnBSr. Software EngineerCommented:
0
 
hidrauAuthor Commented:
Merinjb,

I need to use MediaPlayer because I have many kind of controls with it and my form.

My problem is being only that, to know how is the state of it.

there is an option that It isn't work or I don't know how to work correctly with it, it is mpNotReady .

If I don't open a file with it to play, what state of my mediaplayer is? I noticed that all Mediaplayer buttons is enabled = false, then, there must be a way to get the state of it when it is with all buttons false.
0
 
MerijnBSr. Software EngineerCommented:
How about if you change the code in your first post to this:

if (not (MediaPlayer1.Mode in [Low(TMPModes)..High(TMPModes)])) or (MediaPlayer1.Mode = mpNotReady) Then
Begin
  ShowMessage('Not ready');
End;

Open in new window


* edited the post since I made a mistake
0
 
hidrauAuthor Commented:
Thanks very much
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now