Solved

How to know if MediaPlayer opened or closed the file?

Posted on 2014-09-24
8
342 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

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!

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

623 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