Solved

Trackbar and mediaplayer

Posted on 1997-11-11
5
350 Views
Last Modified: 2010-05-18
hi,

how do I get the trackbar to display the playing time when opening a mediafile, and when starting to play, to update the trackbar to the playing position.
0
Comment
Question by:hellfire052497
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 150 total points
Comment Utility
Hellfire, try this:

Trackbar1.Position := MediaPlayer1.Position

Good luck with your project!
Pegasus

P.S. You may also have to set the start and end positions (min/max) of the trackbar to correspond with how many "frames", etc are in the media file.
0
 
LVL 3

Expert Comment

by:Pegasus100397
Comment Utility
side note: MediaPlayer1.Position is a a time value. Depending on what time values you want (minutes, seconds, etc) you will have to do some time juggling to get the trackbar to sync with the mediaplayer. Also, use a TTimer (about 1 sec) apart to set the trackbar position.

If you just need to indicate what track it's on, use MediaPlayer1.Trackposition.
0
 

Author Comment

by:hellfire052497
Comment Utility
I have decided to use a progressbar, Now this is used different then Trackbar so could you please explain how to use this, when searching in help it says to look at StepIt, but when I click on the example button I get an error saying not found, so help!!
and also, when mediaplayer is open how do I close it? I tried
If MediaPlayer1 := open then Mediaplayer1.close; but it didn't work. it is the first time I use MediaPlayer and a progressbar.
thanks.
0
 
LVL 3

Expert Comment

by:Pegasus100397
Comment Utility
Hellfire, what type of media are you playing with the media player? .WAV files? CDs? Curious because the routines are a little different for each.

The StepIt method is used as follows:
ProgressBar1.StepIt;

It's just a convienient way to increment the progress bar. Each call to StepIt will increment the progress bar the amount of the Step property.

to Stop the Mediaplayer issue Mediaplayer1.Stop

to actually make it "go away" (hide it, but leave it available) issue Mediaplayer1.Visible := False;

regards,
Pegasus
0
 

Author Comment

by:hellfire052497
Comment Utility
with the Mediaplayer1.stop I know how to call it, but how do I check if MediaPlayer1.open is true and if so then to close it.
and also vice versa.

The idea was to make a general mediaplayer, so that it would play all supported files. (I use the autoselect for mediatype)

And how to use that progressbar?
if I open a file, I should set the min tracktime as 0 and the max tracktime as 100 for the progressbar, and when starting to play to increment the progressbar, probably with a timer.
But I have no idea how to make this, could you give a small example??
Thanks


0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now