Solved

How to know if MediaPlayer opened or closed the file?

Posted on 2014-09-24
8
330 Views
Last Modified: 2014-09-25
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
Comment
Question by:hidrau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 19

Expert Comment

by:MerijnB
ID: 40343329
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
 
LVL 1

Author Comment

by:hidrau
ID: 40343384
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
 
LVL 19

Expert Comment

by:MerijnB
ID: 40343426
What kind of file are you playing, audio, video, etc?
0
Technology Partners: 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!

 
LVL 1

Author Comment

by:hidrau
ID: 40343429
Audio file
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40343459
0
 
LVL 1

Author Comment

by:hidrau
ID: 40343552
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
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
ID: 40343571
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
 
LVL 1

Author Closing Comment

by:hidrau
ID: 40344894
Thanks very much
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 157
Delphi 2 92
Breakpoint doesn't stop in my variable 3 48
can i put an image from resource into image tag ? 6 42
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question